def binary_search(array, key)
    left = 0
    right = array.length
    while left < right
        mid = (left + right) / 2
        if array[mid] == key
            return mid
        elsif key < array[mid]
            right = mid
        else
            left = mid + 1
        end
    end
    return -1
end

line_count = gets.to_i
array = gets.split(" ").map(&:to_i)
search_count = gets.to_i
search_array = gets.split(" ").map(&:to_i)
puts search_array.count{|n| binary_search(array, n) > 0}

