import java.util.Scanner; public class Main { public static void main(String[] args) { int d = 1000000000 + 7; Scanner scan = new Scanner(System.in); int N = scan.nextInt(); scan.close(); int[][] dp = new int[N + 1][3]; dp[0][0] = 1; for(int i = 1; i <= N; i++) { dp[i][0] = (dp[i - 1][1] + dp[i - 1][2]) % d; dp[i][1] = dp[i - 1][0] % d; dp[i][2] = dp[i - 1][1] % d; } int ans = dp[N][0] + dp[N][1] + dp[N][2]; ans = ans % d; System.out.println(ans); } }