#include #include #include #include #include #include #include #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long int; using namespace std; const int MOD = 1e9 + 7; ll dp[1000010][3]; int N; int main() { dp[1][0] = 1; dp[2][1] = 1; dp[3][2] = 1; cin >> N; for (int i = 1; i < N; i++) { dp[i + 1][0] += (dp[i][1] + dp[i][2]) % MOD; dp[i + 2][1] += (dp[i][0] + dp[i][2]) % MOD; dp[i + 3][2] += (dp[i][0] + dp[i][1]) % MOD; } cout << (dp[N][0] + dp[N][1] + dp[N][2]) % MOD << endl;; return 0; }