/* -*- coding: utf-8 -*- * * 314.cc: No.314 ケンケンパ - 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; typedef long long ll; const ll MOD = 1000000007; /* typedef */ /* global variables */ ll dp[MAX_N + 1]; /* subroutines */ /* main */ int main() { ll n; cin >> n; dp[0] = 1; for (int i = 1; i <= n; i++) for (int j = 2; j <= 3; j++) if (i >= j) dp[i] = (dp[i] + dp[i - j]) % MOD; ll sum = 0; for (int i = 0; i <= 2; i++) if (n >= i) sum = (sum + dp[n - i]) % MOD; printf("%lld\n", sum); return 0; }