His money is 4 equal units. Three of them ($12) were spent on the book.

Money$4$4$4$4book $12 = 3 units

Plain numbers are given; italic underlined numbers are worked out.

  1. 3 units → $12
  2. 1 unit → $12 ÷ 3 = $4
  3. At first = 4 units → 4 × $4 = $16

He had $16 at first.

Check: 34 of $16 = $12. ✓