MOD = 10 ** 9 + 7 n = int(input()) if n == 1: print(2) exit() if n & 1: ans = 3 else: ans = 1 ans *= 4 * pow(5, n // 2 - 1, MOD) print(ans % MOD)