If all 52 coins were nickels, the value would be 52*5 = 260 cents, or $2.60.
The actual value is $5.80, which is $3.20 more, or 320 cents more.
Each quarter is worth 20 cents more than each nickel. To make that additional 320 cents, the number of nickels we need to replace with quarters is 320/20 =16.
So there are 16 quarters; that means 52-16 = 36 dimes.
Check: 16(25)+36(5) = 400+180 = 580 cents = $5.80
Algebraically....
let x = number of quarters
then 52-x = number of nickels