What he had at first is the whole bar: what he spent plus what was left.

[[model:questions/solutions/q2353.png]]

• At first → $17 + $28 = $45

He had $45 at first.
Check: $45 − $17 = $28 left. ✓