def find(target, list):
  for i in xrange(len(list)):
    if target == list[i]:
      return 1
  return 0


n = int(raw_input())
S = raw_input().split()
q = int(raw_input())
T = raw_input().split()
count = 0
for i in xrange(q):
  count += find(T[i], S)
print count def find(target, list):
  for i in xrange(len(list)):
    if target == list[i]:
      return 1
  return 0 find for i in xrange(len(list)):
    if target == list[i]:
      return 1
   i xrange(len(list)) xrange len(list) len list if target == list[i]:
      return 1
   target == list[i] target list[i] list i return 1 1 return 0 0 target target list list n = int(raw_input()) n int(raw_input()) int raw_input() raw_input S = raw_input().split() S raw_input().split() ().split () raw_input split q = int(raw_input()) q int(raw_input()) int raw_input() raw_input T = raw_input().split() T raw_input().split() ().split () raw_input split count = 0 count 0 for i in xrange(q):
  count += find(T[i], S) i xrange(q) xrange q count += find(T[i], S) count find(T[i], S) find T[i] T i S print T = raw_input().split() raw_input().split() T q = int(raw_input()) int(raw_input()) q n = int(raw_input()) int(raw_input()) n S = raw_input().split() raw_input().split() S count += find(T[i], S) find(T[i], S) count count = 0 0 count def find(target, list):
  for i in xrange(len(list)):
    if target == list[i]:
      return 1
  return 0 def find(target, list):
  for i in xrange(len(list)):
    if target == list[i]:
      return 1
  return 0 find
def find(target, list):
  for i in xrange(len(list)):
    if target == list[i]:
      return 1
  return 0


n = int(raw_input())
S = raw_input().split()
q = int(raw_input())
T = raw_input().split()
count = 0
for i in xrange(q):
  count += find(T[i], S)
print count