#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair P; const ll INF = 1ll<<29; const ll MOD = 1000000007; const double EPS = 1e-10; int n; ll dp[2][2][4]; // i, 種類, 回数 int main() { cin >> n; dp[0][0][0] = 1; REP(i, n) { int now = i % 2; int next = (i + 1) % 2; fill(dp[next][0], dp[next][2], 0); REP(j, 2) { if (j == 0) { REP(k, 3) { if (k < 2) (dp[next][0][k + 1] += dp[now][j][k]) %= MOD; if (k > 0) (dp[next][1][1] += dp[now][j][k]) %= MOD; } } else { (dp[next][0][1] += dp[now][j][1]) %= MOD; } } } ll ans = 0; REP(i, 2) REP(j, 4) (ans += dp[n % 2][i][j]) %= MOD; cout << ans << endl; return 0; }