N=int(input()) if N==0: print(0) exit() s="142857" ANS=["0."] for _ in range(N//6): ANS.append(s) ANS.append(s[:N%6]) print("".join(ANS))