3 hats each is the largest amount Brian can buy
To get this answer I multiplied 3 friends by $5 amount of each hat and got $15 then I divided that into 57$ and got 3.8. So he can only afford to get each friend 3 hats each Brian should have $12 left
I hope this helps you
x/3+y/-1=1
x/3-y=1
x-3y/3=1
x-3y=3