n = int(input()) if n==1: print(2) else: ans = pow(5,n//2-1,1000000007)*4 if n%2==1: ans *= 3 print(ans%1000000007)