Wandering Circus#4397

Wandering Circus

2 seconds
64 megabytes
Very easy

One of the shamans (in those rare moments when he isn't building dams) works as the director of the traveling circus "Romashka". The main attraction of this circus is the performance featuring both Indian and African elephants on the same stage.

The circus has elephants, conveniently numbered from to for training purposes. During the act, the elephants come onto the stage in a specific sequence to entertain the audience. For example, if the circus has three elephants, the performance might proceed with elephant number one entering first, then elephant number three, and then elephant number two.

To keep the audience returning, the director ensures that each show is unique. Two performances are considered different if the elephants appear in a different order. Therefore, each day, the elephants perform in a sequence that has not been repeated before. In the case of three elephants, they would perform in the following orders:

Each day, the director selects the order of the elephants in a fairly predictable way: among all possible orders, he picks the one where elephant number one performs first. Among those, he chooses the one where elephant number two performs first, and so forth.

The LKSH students attended the circus on the -th day. They thoroughly enjoyed the show and wanted to share the experience with their friends. However, they forgot which elephant performed first. Please help them! Write a program to determine which elephant performed first on the -th day. Remember, the circus may have been running for a long time.

Input

The first line of the input contains a single number (1 \leq N \leq 10^5).

Output

Output a single number — the number of the elephant that performed first on the -th day.

Examples

Example 1

Loading
Loading