#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
ll INF = 1e18;
ll MOD = 1e9 + 7;

int main(){
    ll N;
    cin >> N;

    ll dp[N+1][3];
    rep(i,0,N+1) rep(j,0,3) dp[i][j] = 0;
    dp[0][0] = 1;

    rep(i,1,N+1) rep(j,0,3){
        if(j-1>=0){
            dp[i][j] += dp[i-1][j-1];
        }
        else{
            dp[i][0] += (dp[i-1][1] + dp[i-1][2])%MOD;
        }
        dp[i][j] %= MOD;
    }

    cout << dp[N][0] + dp[N][1] + dp[N][2] << endl;
}