def main(): def comb(a,b): return fac[a]//fac[b]//fac[a-b] fac=[1] for x in range(1,7): fac.append(fac[-1]*x) n=int(input()) if n<6: print(0) exit() ans=sum(pow(k/6,n)*comb(6,k)*(-1)**k for k in range(1,7)) print(ans) main()