#include #include #include #include #include #include #include #include #include #include #include #include //#include "toollib.h" #define INT_MAX 2147483647 #define Loop(i, n) for(int i = 0; i < (int)n; i++) #pragma warning (disable:4018) using namespace std; typedef long long int lint; //***** Main Program ***** int main() { const lint MOD = 1e9 + 7; int N; cin >> N; if (N == 1) cout << 1 << endl; else if (N == 2) cout << 2 << endl; else { vector a(N - 1), b(N - 1), c(N - 1); a[0] = 0; b[0] = 1; c[0] = 1; Loop(i, N - 2) { a[i + 1] = c[i]; b[i + 1] = a[i]; c[i + 1] = (a[i] + b[i]) % MOD; } cout << (a[N - 2] + b[N - 2] + c[N - 2])%MOD << endl; } return 0; }