using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Linq.Expressions; using System.Text; namespace Program { class MainClass { //////////////////////////////////////////////////////////// void Solve() { Time T = new Time(2015); Mat mat = new Mat(); int ans = 0; T.M.Length.REP(i => T.D[i].REP(j => { if (T.M[i] == mat.DigValArr(j+1).Sum()) ans++; })); io.o(ans); } //////////////////////////////////////////////////////////// public static void Main() { new MainClass().Stream(); } IO io = new IO(); void Stream() { Solve(); io.writeFlush(); } //void Stream() { Test(); io.writeFlush(); } void Test() { } #region MockMacro //cannot use break,continue,goto void FOR(int a, int b, Action act) { for (int i = a; i < b; ++i) act(i); } void FORR(int a, int b, Action act) { for (int i = a - 1; i >= b; --i) act(i); } #endregion //////////////////////////////////////////////////////////// } class Mat { public int mod = 1000000007;//10^9+7 public long Pow(long a, long b) { if (b == 0) return 1; if (b % 2 == 1) return (a % mod * Pow(a % mod, b - 1) % mod) % mod; else return Pow(a * a % mod, b / 2) % mod; } public long Fact(long n) { long ret = 1; for (long i = 1; i <= n; i++) ret = (ret * i) % mod; return ret; } public long C(long n, long r) { if (r == 0 || n == r) return 1; if (n == 0) return 0; if (n < 0 || n < r) throw new ArgumentException("n,r invalid"); else return (Fact(n) % mod * Pow((Fact(n - r) % mod * Fact(r) % mod) % mod, mod - 2) % mod) % mod; } public long DupC(long n, long r) { return C(n + r - 1, r); } public long P(long n, long r) { return Fact(n) / (Fact(n - r)); }//test public bool isPrime(long n) { if (n == 2) return true; if (n < 2 || n % 2 == 0) return false; for (long v = 3; v <= (long)Math.Sqrt(n); v += 2) if (n % v == 0) return false; return true; } public long LCM(long a, long b) { return a * (b / GCD(a, b)); } public long LCM(params long[] a) { return a.Aggregate((v, n) => LCM(v, n)); } public long GCD(long a, long b) { if (a < b) Swap(ref a, ref b); return b == 0 ? a : GCD(b, a % b); } public long GCD(params long[] array) { return array.Aggregate((v, n) => GCD(v, n)); } public T Max(params T[] a) { return a.Max(); } public T Min(params T[] a) { return a.Min(); } public void Swap(ref T a, ref T b) { T tmp = a; a = b; b = tmp; } public double Dis(int x1, int y1, int x2, int y2) { return Math.Sqrt(Math.Pow((x2 - x1), 2) + Math.Pow((y2 - y1), 2)); } public int mDis(int x1, int y1, int x2, int y2) { return Math.Abs(x1 - x2) + Math.Abs(y1 - y2); } public int Dig2Num(IEnumerable enu) {//test int ret = 0; foreach (var v in enu) { ret *= 10; ret += v; } return ret; } public int Digit(long n) { return (n == 0) ? 1 : (int)Math.Log10(n) + 1; } public int DigVal(int n, int dig) { return (n % (int)Pow(10, dig)) / (int)Pow(10, dig - 1); } public int[] DigValArr(int n) { int[] ret = new int[Digit(n)]; ret.Length.REP(i => ret[i] = DigVal(n, i + 1)); return ret; } public long Tousa(long a, long d, long n) { return a + (n - 1) * d; } public long TousaSum(long a, long d, long n) { return n * (2 * a + (n - 1) * d) / 2; } public IEnumerable eunP(int[] Arr, int Use = -1) {//列挙順列 Use = (Use != -1) ? Use : Arr.Length; if (Use == 0 || Arr.Length < Use) yield break; var s = new Stack>(); Arr.Length.REPR(i => s.Push(new List() { i })); while (s.Count > 0) { var cur = s.Pop(); if (cur.Count == Use) { var ret = new List(); cur.ForEach(X => ret.Add(Arr[X])); yield return ret.ToArray(); } else Arr.Length.REPR(i => { if (!cur.Contains(i)) s.Push(new List(cur) { i }); }); } } public IEnumerable enuC(int[] Arr, int Use = -1) {//列挙組み合わせ Use = (Use != -1) ? Use : Arr.Length; if (Use == 0 || Arr.Length < Use) yield break; var s = new Stack>>(); Arr.Length.REPR(i => s.Push(Tuple.Create(i, new List() { Arr[i] }))); while (s.Count > 0) { var cur = s.Pop(); if (cur.Item2.Count == Use) yield return cur.Item2.ToArray(); else for (int i = Arr.GetUpperBound(0); i > cur.Item1; i--) s.Push(Tuple.Create(i, new List(cur.Item2) { Arr[i] })); } } public IEnumerable eunDupP(int[] Arr, int Use = -1) {//列挙重複順列 Use = (Use != -1) ? Use : Arr.Length; if (Use == 0) yield break; var s = new Stack>(); Arr.Length.REPR(i => s.Push(new List() { Arr[i] })); while (s.Count > 0) { var cur = s.Pop(); if (cur.Count == Use) yield return cur.ToArray(); else Arr.Length.REPR(i => s.Push(new List(cur) { Arr[i] })); } } public IEnumerable enuDupC(int[] Arr, int Use = -1) {//列挙組み合わせ Use = (Use != -1) ? Use : Arr.Length; if (Use == 0) yield break; var s = new Stack>>(); Arr.Length.REPR(i => s.Push(Tuple.Create(i, new List() { Arr[i] }))); while (s.Count > 0) { var cur = s.Pop(); if (cur.Item2.Count == Use) yield return cur.Item2.ToArray(); else for (int i = Arr.GetUpperBound(0); i >= cur.Item1; i--) s.Push(Tuple.Create(i, new List(cur.Item2) { Arr[i] })); } } public IEnumerable enuPart(string str) { var s = new Stack, int>>(); s.Push(Tuple.Create(str[0].ToString(), new List(), 1)); while (s.Count > 0) { var cur = s.Pop(); if (cur.Item3 >= str.Length) { yield return (new List(cur.Item2) { cur.Item1.toLong() }).ToArray(); } else { //繋げる s.Push(Tuple.Create(cur.Item1 + str[cur.Item3], new List(cur.Item2), cur.Item3 + 1)); //繋がない s.Push(Tuple.Create(str[cur.Item3].ToString(), new List(cur.Item2) { cur.Item1.toLong() }, cur.Item3 + 1)); } } } } class Time { public int[] M = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; public int[] D = { 31, -1, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; public Time() { D[1] = 28; } public Time(int y) { D[1] = isLeapYear(y) ? 29 : 28; } public bool isLeapYear(int y) { return (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)); } } #region default class IO { TYPE tp; string[] nextBuffer; int BufferCnt; char[] cs = new char[] { ' ' }; StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false }; public IO() { nextBuffer = new string[0]; BufferCnt = 0; Console.SetOut(sw); tp = new TYPE(); } public string Next() { if (BufferCnt < nextBuffer.Length) return nextBuffer[BufferCnt++]; string st = Console.ReadLine(); while (st == "") st = Console.ReadLine(); nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries); BufferCnt = 0; return nextBuffer[BufferCnt++]; } public string String => Next(); public char Char => char.Parse(String); public int Int => int.Parse(String); public long Long => long.Parse(String); public double Double => double.Parse(String); public string[] arr => Console.ReadLine().Split(' '); public char[] arrChar => Array.ConvertAll(arr, char.Parse); public int[] arrInt => Array.ConvertAll(arr, int.Parse); public long[] arrLong => Array.ConvertAll(arr, long.Parse); public double[] arrDouble => Array.ConvertAll(arr, double.Parse); public T i() { return tp.suitType(String); } public void i(out T v) { v = tp.suitType(String); } public void i(out T v1, out U v2) { i(out v1); i(out v2); } public void i(out T v1, out U v2, out V v3) { i(out v1); i(out v2); i(out v3); } public void i(out T v1, out U v2, out V v3, out W v4) { i(out v1); i(out v2); i(out v3); i(out v4); } public void i(out T v1, out U v2, out V v3, out W v4, out X v5) { i(out v1); i(out v2); i(out v3); i(out v4); i(out v5); } public void ini(out T[] a, int n) { a = new T[n]; for (int i = 0; i < n; i++) a[i] = tp.suitType(String); } public void ini(out T[] a, out U[] b, int n) { a = new T[n]; b = new U[n]; for (int i = 0; i < n; i++) { a[i] = i(); b[i] = i(); } } public void ini(out T[] a, out U[] b, out V[] c, int n) { a = new T[n]; b = new U[n]; c = new V[n]; for (int i = 0; i < n; i++) { a[i] = i(); b[i] = i(); c[i] = i(); } } public void ini(out T[,] a, int h, int w) { a = new T[h, w]; for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) a[i, j] = i(); } public void o(T v) { Console.WriteLine(v); } public void o(params T[] a) { Array.ForEach(a, n => o(n)); } public void o(T[,] a) { a.GetLength(0).REP(i => { a.GetLength(1).REP(j => or(a[i, j] + " ")); br(); }); } public void ol(T v) { Console.Write(v + " "); } public void ol(params T[] a) { o(connect(a)); } public void or(T a) { Console.Write(a); } public void br() { o(""); } public void writeFlush() { Console.Out.Flush(); } private string connect(params T[] s) { return string.Join(" ", s); } } class TYPE { public bool typeEQ() { return typeof(T).Equals(typeof(U)); } public T convertType(U v) { return (T)Convert.ChangeType(v, typeof(T)); } public T suitType(string s) { if (typeEQ()) return convertType(int.Parse(s)); if (typeEQ()) return convertType(long.Parse(s)); if (typeEQ()) return convertType(double.Parse(s)); if (typeEQ()) return convertType(char.Parse(s)); return convertType(s); } } #endregion #region Ex static class StringEX { public static string Reversed(this string s) { return string.Join("", s.Reverse()); } public static string Repeat(this string s, int n) { return string.Concat(Enumerable.Repeat(s, n).ToArray()); } public static int toInt(this string s) { int n; return (int.TryParse(s.TrimStart('0'), out n)) ? n : 0; } public static int toInt(this char c) { return toInt(c.ToString()); } public static int toInt(this char[] c) { return toInt(new string(c)); } public static long toLong(this string s) { long n; return (long.TryParse(s.TrimStart('0'), out n)) ? n : (long)0; } public static long toLong(this char c) { return toLong(c.ToString()); } public static long toLong(this char[] c) { return toLong(new string(c)); } public static string toString(this char[] c) { return new string(c); } } static class NumericEx { public static string pad0(this T v, int n) { return v.ToString().PadLeft(n, '0'); } public static double RoundOff(this double v, int n) { return Math.Round(v, n - 1, MidpointRounding.AwayFromZero); } public static bool Odd(this int v) { return v % 2 != 0; } public static bool Odd(this long v) { return v % 2 != 0; } public static void REP(this int v, Action act) { for (int i = 0; i < v; ++i) act(i); } public static void REPR(this int v, Action act) { for (int i = v - 1; i >= 0; --i) act(i); } } static class ArrayEX { public static T[] Sort(this T[] a) { Array.Sort(a); return a; } public static T[] SortR(this T[] a) { Array.Sort(a); Array.Reverse(a); return a; } public static void Set(this T[] a, T v) { a.Length.REP(i => a[i] = v); } public static void Set(this T[,] a, T v) { a.GetLength(0).REP(i => a.GetLength(1).REP(j => a[i, j] = v)); } } #endregion }