#!/usr/bin/env python # -*- coding:utf-8 -*- from collections import defaultdict def main(): N = input() d = defaultdict(int) for _ in range(N): a, b, c = map(int, raw_input().split()) d[a] += 1 d[b] += 1 d[c] += 1 powerup_cnt = 0 remain_items = 0 for index in d: powerup_cnt += d[index] / 2 remain_items += d[index] % 2 powerup_cnt += remain_items / 4 print(powerup_cnt) if __name__ == "__main__": main()