import java.io.*; import java.util.*; public class Main_yukicoder533 { private static Scanner sc; private static Printer pr; private static void solve() { final int MOD = 1_000_000_007; int n = sc.nextInt(); long[][] dp = new long[3][n + 10]; dp[0][1] = 1; dp[1][2] = 1; dp[2][3] = 1; for (int i = 1; i <= n; i++) { for (int j = 0; j < 3; j++) { if (dp[j][i] == 0) { continue; } if (i + (j + 1) % 3 + 1 <= n) { dp[(j + 1) % 3][i + (j + 1) % 3 + 1] += dp[j][i]; dp[(j + 1) % 3][i + (j + 1) % 3 + 1] %= MOD; } if (i + (j + 2) % 3 + 1 <= n) { dp[(j + 2) % 3][i + (j + 2) % 3 + 1] += dp[j][i]; dp[(j + 1) % 3][i + (j + 1) % 3 + 1] %= MOD; } } } pr.println((dp[0][n] + dp[1][n] + dp[2][n]) % MOD); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }