N=int(input()) S="142857" if N==0: print(0) else: if N%6==0: print("0."+S*int(N/6)) else: print("0."+S*int(N/6)+S[:int(N%6)])