#include using namespace std; #define rep(i, n) for(int i = 0; i < (int)n; ++i) #define FOR(i, a, b) for(int i = a; i < (int)b; ++i) #define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i) typedef long long ll; typedef long double ld; const int Inf = 1e9; const double EPS = 1e-9; const ll MOD = 1e9 + 7; int main() { cin.tie(nullptr); ios::sync_with_stdio(0); int n; cin >> n; vector > dp(n + 5, vector(4)); dp[0][0] = 1; rep (i, n) { rep (j, 4) { if (dp[i][j] == 0) continue; FOR (k, 1, 4) { if (j == k) continue; if (i + k > n) continue; dp[i + k][k] += dp[i][j]; dp[i + k][k] %= MOD; } } } ll res = 0; rep (i, 3) { res += dp[n][i + 1]; res %= MOD; } cout << res << endl; return 0; }