Charles and Dan had an equal number of

apples. After Charles sold 180 apples and Dan sold
108 apples, the number of apples Charles had left
was 1/5 of the total number of apples both of them
had left. How many apples did Dan have at first?

number of apples for Charles --- c

number of apples for Dan ------ d

after sale:
Charles had c-180
Dan had d-108

c-180 = (1/5)(c-180 + d-108)
5c - 900 = c-180 + d - 108
but c = d
5c - 900 = c-180 + c - 108
3c = 612
c = 204 , and of course since c =d , d = 204