the friends have 1p each, the till has 25p in, the waiter has 2p
(1x3)+25+2 = 30.
in the sum you posted, you are counting the money which is not in the possession of the friends, and that which is in the possession of the waiter. tha's just rubbish, since some which the friends do not have, the waiter has, not the till, and some money in the till is not counted.