#include #include using namespace std; using mint = atcoder::modint1000000007; int main(){ int n; cin >> n; vector> dp(n + 5); dp[1][0] = 1; dp[2][1] = 1; dp[3][2] = 1; for(int i = 1; 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][j]; } } } cout << (dp[n][0] + dp[n][1] + dp[n][2]).val() << '\n'; }