408278: GYM103076 A The Best Aim

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. The Best Aimtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

The year is 2077, everyone lives in the Cyberpunk era and Laser Aim is the most popular sport of the decade.

In the classic mode, the player is put in a corner of a square-shaped field and must shoot the target, which is placed at the opposite corner of the square. The fun comes from the walls being made out of mirrors, so a laser can hit the wall and be reflected with the same angle of incidence.

In order to earn the most points, a shot must hit the target after the most reflections possible. The problem is that each time the laser hits a wall, it loses a bit of intensity, until it disappears after $$$N+1$$$ reflections.

Lami wants to become the best Laser Aim athlete and promises he's able to find all angles that maximize his score. And in order to practice, he asked for your help!

Given a Laser Gun, described by the maximum number of times its laser can be reflected, determine how many angles Lami must find.

Input

An integer $$$N$$$, the maximum number of times the laser can be reflected before disappearing.

$$$0 \le N \le 10^{14}$$$

Output

An integer $$$M$$$, the amount of angles Lami must find.

ExamplesInput
1
Output
1
Input
2
Output
2
Note

In the first case, it's impossible to shoot the target with a single reflection, therefore, he can only shoot it directly.

In the second case, it's possible to shoot at 1/3 of the height or 1/3 of the width, totalizing 2 angles.

加入题单

算法标签: