Codeforces Round 382 (Div. 1)
A
Tennis Championship
Codeforces
未评级
原题
←B →
翻译中…

Famous Brazil city Rio de Janeiro holds a tennis tournament and Ostap Bender doesn't want to miss this event. There will be $*n*$ players participating, and the tournament will follow knockout rules from the very first game. That means, that if someone loses a game he leaves the tournament immediately.

翻译中…

Organizers are still arranging tournament grid (i.e. the order games will happen and who is going to play with whom) but they have already fixed one rule: two players can play against each other only if the number of games one of them has already played differs by no more than one from the number of games the other one has already played. Of course, both players had to win all their games in order to continue participating in the tournament.

翻译中…

Tournament hasn't started yet so the audience is a bit bored. Ostap decided to find out what is the maximum number of games the winner of the tournament can take part in (assuming the rule above is used). However, it is unlikely he can deal with this problem without your help.

翻译中…

Input

翻译中…

The only line of the input contains a single integer $*n*$ ($2 ≤ *n* ≤ 10^{18}$) — the number of players to participate in the tournament.

翻译中…

Output

翻译中…

Print the maximum number of games in which the winner of the tournament can take part.

翻译中…

Note

翻译中…

In all samples we consider that player number $1$ is the winner.

翻译中…

In the first sample, there would be only one game so the answer is $1$.

翻译中…

In the second sample, player $1$ can consequently beat players $2$ and $3$.

翻译中…

In the third sample, player $1$ can't play with each other player as after he plays with players $2$ and $3$ he can't play against player $4$, as he has $0$ games played, while player $1$ already played $2$. Thus, the answer is $2$ and to achieve we make pairs $(1, 2)$ and $(3, 4)$ and then clash the winners.

翻译中…

样例

Input #1
2
Output #1
1
InputCopy OutputCopy
Input #2
3
Output #2
2
InputCopy OutputCopy
Input #3
4
Output #3
2
InputCopy OutputCopy
Input #4
10
Output #4
4
InputCopy OutputCopy
题目信息
题号
736A
时间限制
2 s
内存限制
256 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。