#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; const ll MOD = 1e9 + 7; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; ll prev[3] = {}; ll cur[3] = {}; prev[0] = 1; for (int i = 0; i < N; i++) { cur[0] = prev[1] + prev[2]; cur[1] = prev[0]; cur[2] = prev[1]; prev[0] = cur[0] % MOD; prev[1] = cur[1] % MOD; prev[2] = cur[2] % MOD; } cout << ((cur[0] + cur[1] + cur[2]) % MOD) << endl; return 0; }