David is collecting stamps. He has x stamps. His friend gave him 15 more stamps. If he now has a total of 47 stamps, how many stamps did David have originally?