#include #include using mint = atcoder::modint1000000007; using namespace std; int main() { int n; cin >> n; vector> dp(3, vector (n + 1)); dp[0][0] = 1; for (int i = 1; i < n; i++){ for (int j = 1; j < 2; j++){ dp[j][i] += dp[j - 1][i - 1]; } for (int j = 0; j < 2; j++){ dp[2][i] += dp[j][i - 1]; } dp[0][i] += dp[2][i - 1]; } mint ans; for (int i = 0; i < 3; i++){ ans += dp[i][n - 1]; } cout << ans.val() << endl; }