#include using namespace std; using ll = long long; using P = pair; using T = tuple; #define al(a) a.begin(), a.end() #define ral(a) a.rbegin(), a.rend() #define sz(a) (int)a.size() #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define db(a, b) cout << #a << ": " << a << " " << #b << ": " << b << endl; #include using namespace atcoder; using mint = modint1000000007; int main() { int n; cin >> n; vector dp(n + 5, vector(5)); dp[0][0] = 1; rep(i, n) { rep(j, 4) rrep(k, 3) { if (j == k) continue; dp[i + k][k] += dp[i][j]; } } mint ans; rep(i, 4) ans += dp[n][i]; cout << ans.val() << endl; return 0; }