let n = Scanf.scanf " %d" (+) 0
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let _ = Array.fold_left (fun (c, p) a -> if a = p then c + 1, 0 else c, a) (0, 0) a_s |> fst |> Printf.printf "%d\n"