let n = read_int ()
let ss = Array.(to_list @@ init n @@ fun _ -> read_line ())
let m = read_int ()
let ts = Array.(to_list @@ init m @@ fun _ -> read_line ())
let f u = List.(length (filter ((=) u) ss) - length (filter ((=) u) ts))
let _ = List.fold_left (fun a s -> max a @@ f s) 0 ss |> Printf.printf "%d\n"