James spent $25 on a shirt. He spent

1/4
of his remaining money on lunch.
1/3 of his money was left. How much money did he have at first?

so he spent 2/3 of his money. That means

25 + 1/4 (x-25) = 2/3 x
Just solve for x