# your code goes here N=int(input()) M=10 for i in range(8): M*=10 M+=7 K1=[1] K2=[0] P=[0] for i in range(1,N): K1.append(P[i-1]) K2.append(K1[i-1]) P.append(K1[i-1]+K2[i-1]) P[i]%=M # print(P) A=K1[N-1]+K2[N-1]+P[N-1] A%=M print(A)