open Hashtbl
let n = Scanf.scanf " %d" (+) 0
let ss = Array.init n @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s
let m = Scanf.scanf " %d" (+) 0
let ts = Array.init m @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s
let h = create n
let f s n = if mem h s then replace h s @@ find h s + n else add h s 1
let _ = Array.iter (fun s -> f s 1) ss; Array.iter (fun t -> f t @@ -1) ts;
  fold (fun _ c m -> max m c) h 0 |> Printf.printf "%d\n"