N = int(input())
ans = 1
now = 1
nxt = 1
while now % N :
	nxt, now = nxt + now, nxt
	ans += 1
print(ans)