Ali has an assortment of coins and notes in his money box. He has nine times as many $1 coins as $5 notes, while there are eight times as many $2 coins as $5 notes. After counting his money Ali discovered that he had exactly $90. How many $2 coins, did he have?

If the quantities of coins are

x = $1
y = $2
z = $5
then we are told

x = 9z
y = 8z
x+2y+5z = 90

now solve for y