x=the number of R2 coins and y=the number of R5 coins.
The number of coins is 30 so x+y=30. Therefore x=30-y.
The value of the coins is R90 so 2x+5y=90. Substitute for x:
2(30-y)+5y=90, 60-2y+5y=90, 60+3y=90, divide through by 3:
20+y=30, so y=30-20=10, and x=30-y=20.
So there were 20 R2 coins and 10 R5 coins.