A number of birds were in a tree. Half flew away. 6 more flew away, a quarter of the birds remained. How many birds were originally in the tree.

0.5x + 6 + 0.25x = x

6 = x - 0.5x - 0.25x

6 = 0.25x

6/0.25 = x

24 = x