New Year Gifts#55

New Year Gifts

1 second
128 megabytes
Easy

For New Year celebrations, a group of friends decided to prepare gift packages. They quickly placed a greeting card and a soft toy in each package. However, when it came time to distribute the mandarins, they faced a problem.

First, they wanted to put mandarins in each package (the other packages would receive apples), but this was not possible: one package ended up with only m-1 mandarins. When they tried to put m-1 mandarins in each package, m-2 mandarins were left. If they distributed m-2 mandarins per package, m-3 mandarins would remain, and so on. Finally, when they tried to put mandarins in each package, mandarin was left over. How many mandarins did they buy?

Input

The number (1 < m \leq 1000) — the number of mandarins they initially wanted to put in each gift package.

Output

Print the smallest possible number of mandarins they could have bought for the gifts.

Examples

Example 1

Loading
Loading

Example 4

Loading
Loading