import java.util.*; public class Main { static int[][] dp; static final int MOD = 1000000007; public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); dp = new int[3][n + 5]; 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++) { for (int k = 0; k < 3; k++) { if (j == k) { continue; } dp[k][i + k + 1] += dp[j][i]; dp[k][i + k + 1] %= MOD; } } } int ans = 0; for (int i = 0; i < 3; i++) { ans += dp[i][n]; ans %= MOD; } System.out.println(ans); } }