import std.algorithm; import std.array; import std.conv; import std.math; import std.range; import std.stdio; import std.string; import std.typecons; int readint() { return readln.chomp.to!int; } int[] readints() { return readln.split.map!(to!int).array; } void main() { const MOD = 1_000_000_007; int n = readint(); auto dp = new long[][](n + 10, 3 + 1); dp[1][1] = dp[2][2] = dp[3][3] = 1; for (int i = 1; i < n; i++) { for (int j = 1; j <= 3; j++) { for (int k = 1; k <= 3; k++) { if (j == k) continue; dp[i + k][k] = (dp[i + k][k] + dp[i][j]) % MOD; } } } long ans = (dp[n][1] + dp[n][2] + dp[n][3]) % MOD; writeln(ans); }