Follow the original $30. At the end of the story, where is it?
$25 of it is still in the hotel's cash register.
$2 is in the bellboy's hand.
$3 are with the three men.
That makes $30.
The intent of the problem is to confuse you by coming up with a sum that is close to the original $30.
The end of the problem as written adds up the $27 the men paid and the $2 the bellboy has, which is PART OF the $27 the men paid. It's double-counting the $2 which, conveniently makes the total $29, a number close enough to $30 to make you think something is up.