n = int(input()) l=[1,1] for _ in range(450): l.append(l[-1]+l[-2]) for i,v in enumerate(l): if v%n == 0: print(i+1) exit()