#include using namespace std; int INF = 1e9 + 7; int main() { int n; cin >> n; long long dp[1000010][3]; for (int i = 0;i < 3;i++)dp[0][i] = 0; dp[1][0] = 0; dp[1][1] = 1; dp[1][2] = 0; for (int i = 2;i <= n;i++) { dp[i][0] = (dp[i - 1][1] + dp[i - 1][2]) % INF; dp[i][1] = dp[i - 1][0] % INF; dp[i][2] = dp[i - 1][1] % INF; } cout << (dp[n][0] + dp[n][1] + dp[n][2]) % INF << endl; }