#include using namespace std; const long long MOD = 1e9 + 7; int main() { int n; cin >> n; long long a = 0, b = 1, c = 0; for (int i = 0; i < n - 1; ++i) { long long aa = a, bb = b, cc = c; a = (bb + cc) % MOD; b = aa % MOD; c = bb % MOD; } cout << (a + b + c) % MOD << endl; return 0; }