import java.util.*; import java.lang.*; import java.io.*; class Main { public static void main (String[] args) { // 入力値の読み込み Scanner sc = new Scanner(System.in); int n = sc.nextInt(); ArrayList a=new ArrayList<>(); for(int i=0;i<3*n;i++){ a.add(sc.next()); } int two=0; int ans =0; // カウント TreeSet b=new TreeSet<>(a); for(String s:b){ int coun=0; for(String c:a){ if(s.equals(c))coun++; } if(coun >= 1){ two += (coun+1)/2; } } ans = two + (3*n-2*two)/4; System.out.println(ans); } }