#include using namespace std; const int mod = 1e9+7; int main(void){ int n; cin >> n; long long sum = 0; long long memo[3]; if(n == 1){ cout << "1" << endl; return 0; }else if(n==2){ cout << "2" << endl; return 0; }else if(n==3){ cout << "2" << endl; return 0; } memo[0]=0; //けんけん memo[1]=1; //けんぱ memo[2]=1; //ぱけん long long tmp1, tmp2, tmp3; for(int i=4; i<=n; i++){ tmp1 = memo[2]; tmp2 = (memo[0] + memo[2])%mod; tmp3 = memo[1]; memo[0] = tmp1; memo[1] = tmp2; memo[2] = tmp3; } sum = (memo[0]+memo[1]+memo[2])%mod; cout << sum%mod << endl; return 0; }