n=int(input()) a=round(1/7,n) if n%6==3 or n%6==2 or n%6==1: a-=1/(10**n) print(a)