module S = Set.Make(String)

let words str = Str.split (Str.regexp " ") str

let () =
  let _ = read_int () in
  let s = read_line () |> words |> S.of_list in
  let _ = read_int () in
  let t = read_line () |> words in
  List.fold_left
    (fun acc e -> match S.mem e s with true -> acc+1 | false -> acc)
    0 t
  |> Printf.printf "%d\n"