P5580 [PA 2015] Fibonacci

Background

Update: output any $k$ that satisfies the condition. Thanks to @[Karry5307](https://www.luogu.com.cn/user/60990) for the correction and the special judge.

Description

As everyone knows, the Fibonacci sequence $F$ satisfies: $$F_0=0,F_1=1,F_m=F_{m-1}+F_{m-2}(2\le m)$$ Now you are given a digit string $S$. Please find the **smallest** $k$ such that $F_k$ ends with $S$.

Input Format

One line containing a digit string $S$.

Output Format

Output the smallest integer $k$ that satisfies the condition. If there is no solution, output `NIE`.

Explanation/Hint

Constraints: for $100\%$ of the testdata, the length of $S$ is at most $18$, and $0\le k