open Scanf
open Printf

let rec scan_list = function
  | 1 -> scanf "%d" (fun k -> [k])
  | n -> scanf "%d " (fun k -> k :: scan_list (n-1))

let count = function
  | [] -> (0, [])
  | x::xs -> let rec f acc = function
      | [] -> (acc, [])
      | y::ys -> if x = y
        then f (acc + 1) ys
        else (acc, (y::ys))
    in f 1 xs

let rec f = function
  | [] -> 0
  | xs -> let c, ys = count xs in
    c / 2 + f ys

let () = let lst = scanf "%d\n" scan_list in
  printf "%d\n" (f lst)