n = int(input()) if n == 0: print(0) else: cycle = "142857142857" print("0." + cycle*(n//12) + cycle[:n%12])