using System; using System.Collections.Generic; using System.Text; using System.Linq; class Program { public void Proc() { Reader.IsDebug = false; this.targetNum = int.Parse(Reader.ReadLine()); ulong ans = this.GetAns(0, targetNum * 6); Console.WriteLine(ans); } private int targetNum = 0; private Dictionary> dic = new Dictionary>(); private ulong GetAns(int idx, int remain) { if (!dic.ContainsKey(idx)) { dic.Add(idx, new Dictionary()); } if (dic[idx].ContainsKey(remain)) { return dic[idx][remain]; } if (remain == 0) { return 1; } if (remain < 0) { return 0; } if (idx == 7) { if (remain <= this.targetNum) { return 1; } else { return 0; } } if ((8 - idx) * targetNum < remain) { return 0; } if ((8 - idx) * targetNum == remain) { return 1; } ulong ans = 0; for (int i = 0; i <= targetNum; i++) { ans += this.GetAns(idx+1, remain - i); } this.dic[idx].Add(remain, ans); return ans; } public class Reader { public static bool IsDebug = true; private static String PlainInput = @" 100 "; private static System.IO.StringReader Sr = null; public static string ReadLine() { if (IsDebug) { if (Sr == null) { Sr = new System.IO.StringReader(PlainInput.Trim()); } return Sr.ReadLine(); } else { return Console.ReadLine(); } } } static void Main() { Program prg = new Program(); prg.Proc(); } }