Ryan used 50 apples to make several pies. He put the same number of apples in each pie. He had 1 apple left over. How many pies did he make ?