using System; using System.Collections.Generic; using System.Linq; public class Program { public static void Main() { long mod = (long)Math.Pow(10, 9) + 7; long N = int.Parse(Console.ReadLine()); var bp = new long[2, 3]; bp[0, 0] = 1; bp[0, 1] = 0; bp[0, 2] = 0; for (int i = 1; i < N; i++) { bp[1, 0] = bp[0, 2]; bp[1, 1] = bp[0, 0]; bp[1, 2] = (bp[0, 0] + bp[0, 1]) % mod; bp[0, 0] = bp[1, 0]; bp[0, 1] = bp[1, 1]; bp[0, 2] = bp[1, 2]; } Console.WriteLine((bp[0, 0] + bp[0, 1] + bp[0, 2]) % mod); } }