n=int(input()) t='142857' d,m=divmod(n,6) print('0'+'.'+t*d + t[:m] if n != 0 else 0)