def linear_search(s, n, key):
    for i in s:
        if i == key:
            return 1
    return 0

n = int(input())
s = list(map(int, input().split()))
q = int(input())
t = list(map(int, input().split()))
ans = 0
for i in t:
    if linear_search(s, n, i) != 0:
        ans += 1
print(ans) def linear_search(s, n, key):
    for i in s:
        if i == key:
            return 1
    return 0 linear_search for i in s:
        if i == key:
            return 1
     i s if i == key:
            return 1
     i == key i key return 1 1 return 0 0 s s n n key key n = int(input()) n int(input()) int input() input s = list(map(int, input().split())) s list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split q = int(input()) q int(input()) int input() input t = list(map(int, input().split())) t list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = 0 ans 0 for i in t:
    if linear_search(s, n, i) != 0:
        ans += 1 i t if linear_search(s, n, i) != 0:
        ans += 1 linear_search(s, n, i) != 0 linear_search(s, n, i) linear_search s n i 0 ans += 1 ans 1 print(ans) print ans s = list(map(int, input().split())) list(map(int, input().split())) s q = int(input()) int(input()) q t = list(map(int, input().split())) list(map(int, input().split())) t ans += 1 1 ans ans = 0 0 ans def linear_search(s, n, key):
    for i in s:
        if i == key:
            return 1
    return 0 def linear_search(s, n, key):
    for i in s:
        if i == key:
            return 1
    return 0 linear_search n = int(input()) int(input()) n
def linear_search(s, n, key):
    for i in s:
        if i == key:
            return 1
    return 0

n = int(input())
s = list(map(int, input().split()))
q = int(input())
t = list(map(int, input().split()))
ans = 0
for i in t:
    if linear_search(s, n, i) != 0:
        ans += 1
print(ans)
