k = int(input()) v = [0.0] * (k + 6) for i in range(k - 1, -1, -1): v[i] = sum(v[i+1:i+7]) / 6.0 + 1.0 print(v[0])