using System; class Program { static void Main(string[] args) { //月と日数の配列の定義 int[] months = new int[12] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; int[] days = new int[12] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; //HappyDayの数 int happyDays = 0; //判定 for (int m = 0; m < months.Length; m++) { for (int d = 1; d <= days[m]; d++) { if (months[m] == d / 10 + d % 10) { happyDays++; } } } //出力 Console.WriteLine(happyDays); } }