N=int(input()) mod=10**9+7 if N==1: print(2) else: if N%2==0: print((4*5**(N//2-1))%mod) else: print((4*5**(N//2-1)*3)%mod)