N = int(input()) if N == 0: print(0) else: s = '142857' q, r = divmod(N, len(s)) print("0." + s * q + s[:r])