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