n = int(input()) l = '142857' if n == 0: print(0) else: x = n // 6 y = x + 1 print('0.' + (y*l)[:n])