#include using namespace std; long long mod = 1000000007; long long ken, kenken, pa, next_ken, next_kenken, next_pa; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; ken = 1; kenken = 0; pa = 0; for (int i = 2; i <= N; i++) { next_ken = pa; next_kenken = ken; next_pa = (ken + kenken); ken = next_ken; kenken = next_kenken; pa = (next_pa > mod) ? next_pa%mod : next_pa; } cout << (ken + kenken + pa) % mod << endl; return 0; }