import java.util.*; public class Main { static final int MOD = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[][] dp = new int[3][n + 4]; dp[0][1] = 1; dp[1][2] = 1; dp[2][3] = 1; for (int i = 1; i < n; i++) { dp[0][i + 1] += dp[1][i] + dp[2][i]; dp[0][i + 1] %= MOD; dp[1][i + 2] += dp[0][i] + dp[2][i]; dp[1][i + 2] %= MOD; dp[2][i + 3] += dp[0][i] + dp[1][i]; dp[2][i + 3] %= MOD; } int ans = 0; for (int i = 0; i < 3; i++) { ans += dp[i][n]; ans %= MOD; } System.out.println(ans); } }