You have £1 in hand + jeans 'worth' £97 = the £98 that you owe. (with the £1 each given back to person 1 & 2 making it up to the total of £100)
The riddle looks like the logical way to tot it all back up, but it actually isn't. It's cleverly done, but the £1 you have in hand should be taken...