#include #include #include using namespace std; int mod = 1000000007; int n; int ans[1000006]; int main() { cin >> n; ans[0] = 0; ans[1] = 1; ans[2] = 2; ans[3] = 2; for (int i = 4; i <= n; i++) { ans[i] = (((ans[i - 2] + ans[i - 3]) % mod) + ans[i - 4]) % mod; } cout << ans[n] << endl; return 0; }