using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yc53cs { class Program { static Decimal[] Cache = new Decimal[99]; static bool[] bWroteCache = new bool[99]; static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); for (int i = 0; i < Cache.Length; i++) { Cache[i] = 0; bWroteCache[i] = false; } Console.WriteLine(Calc(N)); } static Decimal Calc(int k) { if (k == 0) { return 4; } else if (k == 1) { return 3; } else { if (bWroteCache[k - 2]) return Cache[k - 2]; Cache[k - 2] = (19 * Calc(k - 1) - 12 * Calc(k - 2)) / 4; bWroteCache[k - 2] = true; return Cache[k - 2]; } } } }