#include #include using namespace std; using ll = long long int; constexpr ll MOD = 1'000'000'007; int main(){ int n; cin >> n; vector> memo(n+1, vector(3, 0)); memo[0][0] = memo[1][0] = 1; for(int i = 2; i <= n; i++){ for(int j = 0; j < 3; j++){ for(int k = 0; k < 3; k++){ if(i-j-1 < 0 || j == k) continue; memo[i][j] += memo[i-j-1][k]; memo[i][j] %= MOD; } } } cout << (memo[n][0] + memo[n][1] + memo[n][2])%MOD << endl; return 0; }