N = int(input()) s = "142857" q = N//6 r = N%6 if N==0: print(0) else: print("0."+s*q+s[:r])