input()
s = input().split()
input()
t = input().split()

cnt = 0

for t1 in t:
    for s1 in s:
        if t1 == s1:
            cnt += 1
            break

print(cnt) input() input s = input().split() s input().split() ().split () input split input() input t = input().split() t input().split() ().split () input split cnt = 0 cnt 0 for t1 in t:
    for s1 in s:
        if t1 == s1:
            cnt += 1
            break t1 t for s1 in s:
        if t1 == s1:
            cnt += 1
            break s1 s if t1 == s1:
            cnt += 1
            break t1 == s1 t1 s1 cnt += 1 cnt 1 break print(cnt) print cnt cnt = 0 0 cnt t = input().split() input().split() t cnt += 1 1 cnt s = input().split() input().split() s
input()
s = input().split()
input()
t = input().split()

cnt = 0

for t1 in t:
    for s1 in s:
        if t1 == s1:
            cnt += 1
            break

print(cnt)