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