open Scanf
let rec list_init n f = if n <= 0 then [] else let x = f () in x :: list_init (n-1) f
let () =
  let a = scanf " %d" (fun n -> list_init n (fun _ -> scanf " %s" (fun x -> x))) in
  let b = scanf " %d" (fun m -> list_init m (fun _ -> scanf " %s" (fun x -> x))) in
  List.sort_uniq compare a
  |> List.map (fun x ->
      List.length (List.filter ((=) x) a) - List.length (List.filter ((=) x) b))
  |> List.fold_left max 0
  |> Printf.printf "%d\n"