import sys N=int(input()) if N==0: print("0") sys.exit() a=1 b=3 for i in range(1,N): a=10 * a + b + ((3*b) //7 ) b= (3*b) % 7 answer= "0." + "0" * N a=str(a) answer=''.join([a[i-(N+2-len(a))] if i>=N+2-len(a) else answer[i] for i in range(N+2)]) print(answer)