import sys import numpy as np input=lambda:sys.stdin.readline().rstrip() #D,P=map(float,input().split()) K=int(input()) A=[[int(i==j) for i in range(K)] for j in range(K)] b=[[1] for i in range(K)] for i in range(K): for j in range(1,7): if i+jK: A[i][0]-=1/6 A=np.array(A) b=np.array(b) print((np.linalg.inv(A)@b)[0][0])