I rent out 2/5 of my books, give 3 away, buy 9 and now have 27. How many did I start with - I know it's 35 but I can't make the formula work

let X be the number you start with.

3X/5 -3 +9 = 27

3X/5 = 21

3X = 105

I don't see a problem getting 35.