import java.util.*; import java.io.*; import java.math.*; public class No314 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long m = 1000000007; long a[] = {1, 0, 0}; // kp, pk, kk for(int i = 0; i < n; i++) { long t[] = {0, 0, 0}; t[0] += (a[1] + a[2]) % m; t[1] += a[0] % m; t[2] += a[1] % m; a = t; } long ans = 0; for(int i = 0; i < 3; i++) ans += a[i]; System.out.println(ans%m); } }