/* -*- coding: utf-8 -*- * * 533.cc: No.533 Mysterious Stairs - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 1000000; const int K = 3; typedef long long ll; const ll MOD = 1000000007; /* typedef */ /* global variables */ ll dp[MAX_N + 1][K + 1]; /* subroutines */ /* main */ int main() { int n; cin >> n; dp[0][0] = 1; for (int i = 1; i <= n; i++) for (int j = 1; j <= K; j++) if (i >= j) for (int k = 0; k <= K; k++) if (j != k) dp[i][j] += dp[i - j][k], dp[i][j] %= MOD; ll sum = 0; for (int j = 1; j <= K; j++) sum += dp[n][j]; printf("%lld\n", sum % MOD); return 0; }