int_s = gets.to_i
s_arr = gets.split(" ").map(&:to_i)
int_t = gets.to_i
t_arr = gets.split(" ").map(&:to_i)

count1 = s_arr.uniq.count

count2 = (s_arr.uniq - t_arr.uniq).count

ans = count1 - count2
puts ans