# RandGuess-q2
# Exs for Section 45, Q.2, p.159, p.273
# inputs: 2 or 3 or 4 or 5 or 16

import random

M = 10000
n = int(input("n=? "))
tot = 0
for j in range(M):
  r = n-1
  while r != 0:
    r = sum([random.randint(0,1) for i in range(r)])
    tot += 1
print(f"{tot/M:.4f}")
