#include #include #include #include #include #include #include using namespace std; typedef pair P; typedef long long ll; #define For(i, a, b) for(int i = (a); i < (b); i++) #define Rep(i, n) For(i, 0, (n)) const int inf = 999999999; const int mod = 1000000007; ll dp[1000010][3]; int main(){ int n; cin >> n; dp[1][0] = 0; dp[1][1] = 1; dp[1][2] = 0; For(i, 2, n + 1){ dp[i][0] = dp[i - 1][1] + dp[i - 1][2]; dp[i][1] = dp[i - 1][0]; dp[i][2] = dp[i - 1][1]; Rep(j, 3){ dp[i][j] %= mod; } } int ans = 0; Rep(i, 3){ ans += dp[n][i]; ans %= mod; } cout << ans << endl; return 0; }