#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++) #define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++) #define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--) #define int long long int template void chmax(T &a, T b) {a = max(a, b);} template void chmin(T &a, T b) {a = min(a, b);} template void chadd(T &a, T b) {a = a + b;} typedef pair pii; typedef long long ll; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; constexpr ll INF = 1001001001001001LL; constexpr ll MOD = 1000000007LL; int dp[1000010][4]; signed main() { int N; cin >> N; dp[1][1] = 1, dp[2][2] = 1; dp[3][3] = 1; rep(i,1,N) repq(j,1,3) { if(i + j > N) continue; repq(k,1,3) { if(j == k) continue; (dp[i+j][j] += dp[i][k]) %= MOD; } } int ans = 0; repq(i,1,3) (ans += dp[N][i]) %= MOD; cout << ans << endl; return 0; }