n = int(input()) a = "142857" if n == 0: print("0") else: print("0."+a*(n//6) + a[:n%6])