let () = Scanf.scanf "%d\n" @@ fun n ->
  let ss = Array.to_list @@ Array.init n @@ fun _ -> Scanf.scanf "%s\n" @@ fun s -> s in
  Scanf.scanf "%d\n" @@ fun m ->
  let ts = Array.to_list @@ Array.init m @@ fun _ -> Scanf.scanf "%s\n" @@ fun t -> t in
  List.map (fun s ->
    List.length (List.filter (( = ) s) ss) - List.length (List.filter (( = ) s) ts)) ss
  |> List.fold_left max 0
  |> Printf.printf "%d\n"