import java.util.*; import java.util.stream.*; import static java.lang.Math.*; // (ΦωΦ)<何事もやりすぎはよくない public class Main { private void solve() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.nextLine(); List> lines = IntStream.range(0, n) .mapToObj(i -> Stream.of(sc.nextLine().split(" ")) .map(Integer::valueOf) .collect(Collectors.toList())) .collect(Collectors.toList()); List flattened = lines.stream().flatMap(List::stream).collect(Collectors.toList()); Set sett = new HashSet<>(flattened); List values = sett.stream() .map(e -> Collections.frequency(flattened, e)) .collect(Collectors.toList()); long res = values.stream() .map(e -> e/2) .reduce(0, (x, y) -> x + y) + values.stream() .filter(e -> e%2==1) .count() / 4; System.out.println(res); } public static void main(String[] args) { new Main().solve(); } }