N = int(input()) L = "0." L += "142857" * 10**5 if N == 0: print(0) else: print(L[:N+2])