using System; using System.Diagnostics; namespace yukicoder { class Program { static void Main(string[] args) { //敵を倒す回数 int N = int.Parse(Console.ReadLine()); //獲得したアイテムを収納する int[] s = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; //獲得アイテム int[] n =new int[3]; //敵を倒す回数分ループ for (int x = 0; x < N; x++) { //敵を倒す1回分 入力して配列 string[] str = Console.ReadLine().Split(' '); //アイテム番号を配列に入れる for (int i = 0; i < 3; i++) { int a = int.Parse(str[i]); n[i] = a; } //獲得したアイテムを収納する for (int j = 1; j <= 10; j++) { for (int k = 1; k <= 3; k++) { //同じ数字なら if (j == n[k - 1]) { //プラス1する s[j - 1] += 1; } } //Debug.WriteLine(s[j - 1]); } } //合計値 int num = 0; int num1 = 0; int num2 = 0; //あまりの数字を入れる int ans2 = 0; //獲得したアイテムを収納した個数 for (int i=1;i<=10;i++) { //割ったもの int ans = 0; int ans1 = 0; int ans3 = 0; //同じ数字が2つあれば、パワーアップする ans = s[i - 1] / 2; num += ans; //余れば ans1 = s[i - 1] % 2; if(ans1>0) { //余った数字をans2に入れる ans2 += ans1; } //10まで調べて、余った数字を4で割る if(i==10) { ans3 = ans2 / 4; num1 += ans3; //パワーアップした分の合計を求める num2 = num + num1; } } Console.WriteLine(num2.ToString()); } } }