Three friends go to a restaurant for a meal. They receive a bill for $30. They each put in $10, which the server collects and takes to the cash register. At this point, the server realizes that the bill should only have been $25 and is about to return with $5. On the way back to the table the server realises that he cannot divide the coins equally so he decides to put $2 in his own pocket and give each of the friends $1.
Now, each of the friends paid $9. Three times 9 is 27. The server has $2 in his pocket. $2 plus $27 is $29. The ladies originally handed over $30.