#include <bits/stdc++.h>
using namespace std;

#define DUMP(x) cerr << #x << "=" << x << endl
#define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<")"<< endl
#define BINARY(x) static_cast<bitset<16> >(x)

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

#define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()

typedef long long ll;
const int INF   = 1e9;
const ll  INFLL = 1e18;
typedef pair<int, int> PII;
int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1};

const int MOD = 1e9 + 7;
const int MAX_N = 1e6 + 1;
ll dp[MAX_N][3];

int main()
{
    ios::sync_with_stdio(false);
    int N; cin >> N;
    dp[0][0] = 1;

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

    ll ans = 0;
    rep(i, 3) (ans += dp[N][i]) %= MOD;
    cout << ans << endl;
}