# input the number for array of a[]
n = int(input())
a = list(map(int, input().split()))

# input the number for array of b[]
m = int(input())
b = list(map(int, input().split()))

# do the linear search
count = 0
for i in range(m):
    for j in range(n):
        if(b[i] == a[j]):
            count += 1
            break

print(count)
 n = int(input()) n int(input()) int input() input a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split m = int(input()) m int(input()) int input() input b = list(map(int, input().split())) b list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split count = 0 count 0 for i in range(m):
    for j in range(n):
        if(b[i] == a[j]):
            count += 1
            break i range(m) range m for j in range(n):
        if(b[i] == a[j]):
            count += 1
            break j range(n) range n if(b[i] == a[j]):
            count += 1
            break b[i] == a[j] b[i] b i a[j] a j count += 1 count 1 break print(count) print count n = int(input()) int(input()) n a = list(map(int, input().split())) list(map(int, input().split())) a m = int(input()) int(input()) m b = list(map(int, input().split())) list(map(int, input().split())) b count = 0 0 count count += 1 1 count
# input the number for array of a[]
n = int(input())
a = list(map(int, input().split()))

# input the number for array of b[]
m = int(input())
b = list(map(int, input().split()))

# do the linear search
count = 0
for i in range(m):
    for j in range(n):
        if(b[i] == a[j]):
            count += 1
            break

print(count)

