import java.io.BufferedInputStream; import java.io.IOException; import java.lang.reflect.Array; import java.math.BigDecimal; import java.math.BigInteger; import java.util.*; import java.util.Map.Entry; public class Main { public static final int C = 1000000007; //static boolean MAP[][]; static int N; static int Q; static int MAX = -1; //static int tic[][]; static boolean NUM[]; //static int max; static int A[]; static int ST[][]; //static int p[]; //static ArrayList> al; static TreeMap> hm; //static ArrayList al; //static int a[][]; //static char[][] ch; //static ArrayList> al; //static String a[]; //static String str; //static int[] mach = new int[] {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}; public static void main(String[] args) { StringBuilder sb = new StringBuilder(); BufferedInputStream bs = new BufferedInputStream(System.in); Scanner sc = new Scanner(bs); int T = sc.nextInt(); int n[] = new int[T]; int a[][] = new int[T][101]; for (int t=0; t < T; t++) { n[t] = sc.nextInt(); //a[i] = new int[n[i]]; for (int i = 0; i < n[t]; i++) { a[t][sc.nextInt()]++; } } //N = sc.nextInt(); int ans[] = new int[T]; for (int t=0; t < T; t++) { int num = 0; for (int i=1; i <= 100; i++) { if (a[t][i] == 0)continue; a[t][i]--; num++; if (num == 3) { ans[t]++; num = 0; i=0; } } } for (int i=0; i < T; i++) { sb.append(ans[i]+ "\n"); } System.out.print(sb); } }