#include using namespace std; #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif #define int long long const int MOD = 1e9 + 7; signed main(){ int n; cin >> n; static int dp[1000011][3]; dp[1][0] = 1, dp[2][1] = 1, dp[3][2] = 1; for(int i = 0; i < n; i++){ for(int j = 0; j < 3; j++){ for(int k = 0; k < 3; k++){ if(j == k) continue; dp[i+k+1][k] = (dp[i+k+1][k] + dp[i][j]) % MOD; } } } int ans = (dp[n][0] + dp[n][1] + dp[n][2]) % MOD; cout << ans << endl; return 0; }