import java.io.*; import java.util.*; public class Main { static final int MOD = 1000000007; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int[][] dp = new int[Math.max(4, n + 1)][3]; dp[1][0] = 1; dp[2][1] = 1; dp[3][0] = 1; dp[3][1] = 1; dp[3][2] = 1; for (int i = 4; i <= n; i++) { dp[i][0] = (dp[i - 1][1] + dp[i - 1][2]) % MOD; dp[i][1] = (dp[i - 2][0] + dp[i - 2][2]) % MOD; dp[i][2] = (dp[i - 3][0] + dp[i - 3][1]) % MOD; } int ans = ((dp[n][0] + dp[n][1]) % MOD + dp[n][2]) % MOD; System.out.println(ans); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }