#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n) - 1; i >= 0; i--) #define reps(i, n) for (int i = 1; i <= (n); i++) #define repi(i, a, b) for (int i = (a); i < (b); i++) #define all(a) (a).begin(), (a).end() #define bit(b) (1ull << (b)) using namespace std; using i32 = long long; using u32 = unsigned long long; using i64 = long long; using u64 = unsigned long long; using f64 = double; using vi32 = vector; using vu32 = vector; using vi64 = vector; using vu64 = vector; using vf64 = vector; using vstr = vector; using vvi32 = vector; using vvu32 = vector; using vvi64 = vector; using vvu64 = vector; using vvf64 = vector; template void amax(T &x, S y) { if (x < y) x = y; } template void amin(T &x, S y) { if (y < x) x = y; } template class modint { public: int x; modint(): x(0) {} modint(int a) { x = a % mod; if (x < 0) x += mod; } modint &operator+=(modint that) { x = (x + that.x) % mod; return *this; } modint &operator-=(modint that) { x = (x + mod - that.x) % mod; return *this; } modint &operator*=(modint that) { x = (long long) x * that.x % mod; return *this; } modint &operator/=(modint that) { return *this *= that.inverse(); } modint operator-() { return modint(-this->x); } friend ostream& operator<<(ostream &out, modint m) { return out << m.x; } modint inverse() { int a = x, b = mod, u = 1, v = 0; while (b) { int t = a / b; a -= t * b; u -= t * v; swap(a, b); swap(u, v); } return modint(u); } #define op(o, p) modint operator o(modint that) { return modint(*this) p that; } op(+, +=) op(-, -=) op(*, *=) op(/, /=) #undef op #define op(o) bool operator o(modint that) const { return x o that.x; } op(==) op(!=) op(<) op(<=) op(>) op(>=) #undef op }; using mint = modint<1000000007>; mint dp[1000010][3][2]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(16); int n; cin >> n; dp[1][1][0] = 1; reps(i, n - 1) rep(j, 3) rep(k, 2) { if (j >= 1) dp[i + 1][0][1] += dp[i][j][k]; if (j == 1) dp[i + 1][2][0] += dp[i][j][k]; if (k == 1) dp[i + 1][1][0] += dp[i][j][k]; } mint ans = 0; rep(j, 3) rep(k, 2) { ans += dp[n][j][k]; } cout << ans << endl; return 0; }