(* O((max n m)^2) *)
open List;;
let n = read_int () in
let ss = Array.to_list @@ Array.init n @@ fun _ -> read_line () in
let m = read_int () in
let ts = Array.to_list @@ Array.init m @@ fun _ -> read_line () in
let f s = (length @@ filter ((=) s) ss) - (length @@ filter ((=) s) ts) in
map f ss |> fold_left max 0 |> Printf.printf "%d\n"