You are given a sequence of _n_ integers S and a sequence of different _q_ integers T. Write a program which outputs C, the number of integers in T which are also in the set S.
n=int(input())
lista=[0 for i in range(n)]
lista=input().split()
n2=int(input())
listb=[0 for i in range(n2)]
listb=input().split()
cnt=0
for i in range(n2):
    x=0
    for j in range(n):
        if listb[i]==lista[j] and x==0:
            x=1
            cnt+=1


n=int(input())
lista=[int(i) for i in input().split()]
n2=int(input())
listb=[int(i) for i in input().split()]
cnt=0


for i in listb:
    C=int(len(lista)/2)
    D=[0,len(lista)]
    while(1):
        if i<lista[C]:
            for k in D:
                if C>k:
                    d=k
                    break
            D.insert(0,C)
            C=int((C+d)/2)

        elif i>lista[C]:
            for k in D:
                if C<k:
                    d=k
                    break
            D.insert(0,C)
            C=int((C+d)/2)
        else:
            cnt+=1
            break
    
        if C==D[0]:
            break
    
        
print(cnt)
