import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long MOD = (long)Math.pow(10, 9) + 7; long[] dp1 = new long[N + 1]; long[] dp2 = new long[N + 1]; long[] dp3 = new long[N + 1]; dp1[1] = 1; if(N > 1) dp2[2] = 1; if(N > 2) { dp1[3] = 1; dp2[3] = 1; dp3[3] = 1; } for(int i = 4; i < N + 1; i++) { dp1[i] = (dp2[i - 1] + dp3[i - 1]) % MOD; dp2[i] = (dp1[i - 2] + dp3[i - 2]) % MOD; dp3[i] = (dp1[i - 3] + dp2[i - 3]) % MOD; } long ans = dp1[N]; ans = (ans + dp2[N]) % MOD; ans = (ans + dp3[N]) % MOD; System.out.println(ans); } }