N = int(input()) pattan = "142857" times_pattan = N // 6 if N == 0: print(0) else: ans = "0." + (pattan*times_pattan) + pattan[:N % 6] print(ans)