#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define repeat(i, x) for (long long i = 0; (i) < (long long)(x); (i)++) #define rrepeat(i, x) for (long long i = (long long)((x) - 1); (i) >= 0; (i)--) #define traverse(it, ctn) for (auto it = (ctn).begin(); (it) != (ctn).end(); (it)++) #define rtraverse(it, ctn) for (auto it = (ctn).rbegin(); (it) != (ctn).rend(); (it)++) #define enumerate(i, a, b) for (long long i = (long long)(a); (i) < (long long)(b); (i)++) template void chmax(T& a1, T a2) { a1 = std::max(a1, a2); } template void chmin(T& a1, T a2) { a1 = std::min(a1, a2); } template ostream& operator<<(ostream& os, const pair& p) { return os << "(" << p.first << ", " << p.second << ")"; } template ostream& operator<<(ostream& os, const vector& v) { os << "["; for (int i = 0; i < v.size(); i++) os << (i == 0 ? "" : ", ") << v[i]; os << "]"; return os; } template ostream& operator << (ostream& os, map& mp) { os << "{"; for (auto it = mp.begin(); it != mp.end(); it++) { os << "(" << it->first << ": " << it->second << ")"; it++; if(it != mp.end()) os << ", "; it--; } os << "}"; return os; } template ostream& operator << (ostream& os, set& st) { os << "{"; for (auto it = st.begin(); it != st.end(); it++) { os << *it; ++it; if(it != st.end()) os << ", "; it--; } os << "}"; return os; } using int64 = long long; using Graph = std::vector>; const int64 MOD = 1e9 + 7; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; static int64 dp[1000006][3]; dp[0][0] = 1; for (int i = 0; i < N; i++) { for (int j = 0; j < 3; j++) { if (j + 1 < 3) (dp[i + 1][j + 1] += dp[i][j]) %= MOD; if (j > 0) (dp[i + 1][0] += dp[i][j]) %= MOD; } } int64 ans = (dp[N][0] + dp[N][1] + dp[N][2]) % MOD; cout << ans << endl; return 0; }