eolymp
bolt
Try our new interface for solving problems
Problems

Cockroaches

Cockroaches

Trying to get into the refrigerator, cockroach Serge did not have time to dodge the shoes smashing pensioner Agafya Petrovna and died a heroic death. Therefore, in the near darkness of the night remaining cockroaches gathered in the kitchen to get back and arrange a crusade on the fridge. They formed a column of two cockroach in a row. But in the last row there is a place for earrings. Then they rebuilt into a column of three cockroach, but again did not have one. Each time they rebuilt so that on one cockroach in a row was more than last time, and each time they did not have earrings. What is the minimum number of cockroaches can live in an apartment in Agafya Petrovna, if prior to such time as she got up and went to the kitchen to cook your own breakfast, cockroaches had to restructure \textbf{N} times? \InputFile Given a positive integer \textbf{N} (\textbf{N} ≤ 1\textbf{0}). \OutputFile You want to display a single number - the answer to the question.
Time limit 1 second
Memory limit 64 MiB
Input example #1
4
Output example #1
59
Source Stage II Ukrainian School Olympiad 2011-2012, Berdichev