John has $19 in his wallet and he finds $5 on the street. After adding this to his wallet, he discovers a forgotten envelope with $27.97 in it, which he also adds to his wallet. He then heads to a collector's flea market, where he buys 17 vintage comic books, each costing the total amount he currently has in his wallet. How much does he spend in total on the comic books?