#include #include using namespace std; using namespace atcoder; using ll = long long; using mint = modint1000000007; int main(){ int n; cin >> n; if(n <= 3){ cout << 0 << endl; return 0; } vector > dp(n + 1, vector(8)); for(int j = 0; j < 8; ++j){ dp[3][j] = 1; } for(int i = 3; i < n; ++i){ dp[i + 1][0] = (dp[i][0] + dp[i][4]); dp[i + 1][1] = (dp[i][0] + dp[i][4]); dp[i + 1][2] = dp[i][1]; dp[i + 1][3] = (dp[i][1] + dp[i][5]); dp[i + 1][4] = (dp[i][2] + dp[i][6]); dp[i + 1][5] = (dp[i][2] + dp[i][6]); dp[i + 1][6] = (dp[i][3] + dp[i][7]); dp[i + 1][7] = (dp[i][3] + dp[i][7]); } mint s = 0; for(mint& x : dp[n]){ s += x; } mint ans = ((mint)2).pow(n) - s; cout << ans.val() << endl; return 0; }