let n = read_int ()
let ss = Array.init n @@ fun _ -> read_line ()
let m = read_int ()
let ts = Array.init m @@ fun _ -> read_line ()
let _ = Array.(fold_left (fun a u -> max a @@ fold_left (fun p s -> if u = s then p + 1 else p) 0 ss + fold_left (fun p t -> if u = t then p - 1 else p) 0 ts) 0 ss) |> Printf.printf "%d\n"