def twoDimArray(row,column,n): return [[n for j in range(column)] for i in range(row)] n=int(input()) dp=twoDimArray(n,7,0) dp[0][1]=1.0 if n>10000: print("0.999999999999999") for i in range(1,n): for j in range(1,7): dp[i][j]=j/6*dp[i-1][j]+(1-(j-1)/6)*dp[i-1][j-1] print(dp[n-1][6])