#include using namespace std; #define pb push_back typedef long long ll; const ll INF = 1000000000000000000ll; const ll MOD = 1000000007ll; const double EPS = 1e-8; int dp[1000001][3]; int main(void) { //ios_base::sync_with_stdio(false); //cin.tie(0); ll n; cin >> n; dp[0][0] = 1; for(int i=1; i<=n; i++){ dp[i][0] = dp[i-1][1] + dp[i-1][2]; dp[i][1] = dp[i-1][0]; dp[i][2] = dp[i-1][1]; for(int j=0; j<3; j++){ dp[i][j] %= MOD; } } /* for(int i=0; i<=n; i++){ for(int j=0; j<3; j++){ printf("%d ", dp[i][j]); } puts(""); } */ ll ans = dp[n][0]; ans += dp[n][1]; ans %= MOD; ans += dp[n][2]; ans %= MOD; cout << ans << endl; return 0; }