N=int(input()) s="142857"*16667 z="0."+s[:N] if N>0 else "0" print(z)