n = int(input()) if n == 0: print(0) exit() s = '142857' q, r = divmod(n,6) ans = '0.'+'142857'*q+s[0:r] print(ans)