x=lottie's aples
give 1/4 of them to fred
origianly had 4/4, but gave 1/4 away so now has (3/4)x
eats 5 of them
(3/4)x-5
now she has 7 more than fred (fred has (1/4)x
so
(3/4)x-5 is 7 more than (1/4)x
(3/4)x-5=7+(1/4)x
add 5 to both sides
(3/4)x=12+(1/4)x
minus (1/4)x from both sides
(2/4)x=12
(1/2)x=12
times 2/1 both sides
2/2x=24
x=24
she had 24 to begin with