# CoverMultCase-q4
# Section 40, Q.4, p.144, p.268
# input: 8

import random

m = int(input("m=? "))
x = [0]*8
y = [0]*8
count = 0
for i in range(m):
  rcount = 0
  scount = 0
  for j in range(8):
    x[j] = 0
    y[j] = 0
  while (rcount < 8) and (scount < 8):
    r = random.randint(0,7)
    s = random.randint(0,7)
    count += 1
    if x[r] == 0:
      x[r] = 1
      rcount += 1
    if y[s] == 0:
      y[s] = 1
      scount += 1
print(f"{count/m:.5f}")