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