#include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(i,s,e) for (int i = int(s); i < int(e); i++) #define FORIT(i,c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); i++) #define ISEQ(c) (c).begin(), (c).end() int main(){ int N; cin >> N; long ret; if (N == 1){ ret = 1; }else{ long pk = 0; long kk = 1; long kp = 1; long pk_old; long kk_old; long kp_old; while(N > 2){ kp_old = kp; kk_old = kk; pk_old = pk; pk = kp_old; kk = pk_old; kp = (pk_old + kk_old) % 1000000007; N--; }; ret = (pk + kk + kp) % 1000000007; } cout << ret << endl; return 0; }