N = input() a = N // 6 b = N % 6 r = 142857 // 10^(6-b+1) + sum([142857*10^i for i in range(a)]) print(a/10^N)