import numpy as np N=int(input()) def mat(A, N): if N == 0: return np.eye(6) elif N == 1: return A else: if N % 2 == 0: X = mat(A, N//2) return np.dot(X, X) else: X = mat(A, N//2) return np.dot(A, np.dot(X, X)) A = np.zeros((6, 6),dtype="float") for i in range(5): A[i][i] += i+1 A[i][i+1] += 5-i A[5][5]=6 A /= 6 X0 = np.array([1, 0, 0, 0, 0, 0]) X0 = np.dot(X0, mat(A, N-1)) print(X0[-1])