(* O(k^2) (k = max n m) *)
Scanf.scanf " %d" @@ fun n ->
  let ss = Array.init n @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s in
  let m = Scanf.scanf " %d" @@ (+) 0 in
  let ts = Array.init m @@ fun _ -> Scanf.scanf " %s" @@ fun t -> t in
  let ans = ref 0 in
  for i = 0 to n - 1 do
    let c = ref 0 in
    let s = ss.(i) in
    for j = 0 to n - 1 do
      if s = ss.(j) then incr c
    done;
    for j = 0 to m - 1 do
      if s = ts.(j) then decr c
    done;
    ans := max !ans !c
  done;
  Printf.printf "%d\n" !ans