k = int(input()) A = [0 for _ in range(k + 7)] B = [0 for _ in range(k + 7)] for i in range(k + 1,k + 7): A[i] = 1 for i in range(k - 1, -1, -1): B[i] += 1 for j in range(1, 7): A[i] += A[i + j] / 6 B[i] += B[i + j] / 6 print(B[0] / (1 - A[0]))