using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace No314
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			var n = Convert.ToInt32(Console.ReadLine ());

			var k0 = new long[n + 1];
			var k1 = new long[n + 1];
			var k2 = new long[n + 1];

			k0 [0] = 1;

			long mod = 1000000007;

			for (int i = 1; i <= n; i++) {
				k0 [i] = k1 [i - 1] % mod + k2 [i - 1] % mod;
				k1 [i] = k0 [i - 1] % mod;
				k2 [i] = k1 [i - 1] % mod;
			}
			long sum = k0 [n] + k1 [n] + k2 [n];
			sum %= mod;
			Console.WriteLine (sum.ToString ());
		}
	}
}