Ravi had some face masks. He sold 1/4 the face masks on Monday and 82 face masks on Tuesday. He then donated 2/5 of the remaining face masks to a nursing home and 120 face masks to some needy families. In the end, he had 108 face masks left. How much face masks did Ravi have at first?

number of masks ---- x

after Monday sale, masks left = (3/4)x or 3x/4
after Tuesday sale , masks left = 3x/4 - 82
after donaltion, maskes left = (3/5)(3x/4 - 82) - 120

(3/5)(3x/4 - 82) - 120 = 108
(3/5)(3x/4 - 82) = 228
3x/4 - 82 = 380
3x/4 = 462
x = 616