On Thanksgiving, Sam ate of his pies and then gave pies to his grandmother. The next day he ate of his remaining pies and then gave pies to his grandfather. On the third day he ate his final pies. How many pies did Sam have at the beginning?
40
44
48
52
56