function main() N = parse(Int, readline()) L = [BigInt(1), 1] for i in 3:100000 push!(L, L[i - 2] + L[i - 1]) end ans = -1 for i in 1:100000 if L[i] % N == 0 ans = i break end end println(ans) end main()