N = input() if N == 0: print(0) else: a = N // 6 b = N % 6 r = '' for i in range(a): r += '142857' r = r + '142857'[:b] print(f'0.{r}')