let words str = Str.split (Str.regexp " ") str |> List.map int_of_string

let bs elem (a: int array) =
  let rec loop (i_min,i_max) =
    if i_min > i_max then false
    else
      let mid = (i_min+i_max)/2 in
      if a.(mid) = elem then true
      else
        loop (if a.(mid) < elem then mid+1,i_max else i_min,mid-1)
  in loop (0,(Array.length a) -1)


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