n = int(input())
s = input().split()
q = int(input())
t = input().split()
cont = 0
for i in t:
    for o in s:
        if i == o:
            cont +=1
            break

print(cont) n = int(input()) n int(input()) int input() input s = input().split() s input().split() ().split () input split q = int(input()) q int(input()) int input() input t = input().split() t input().split() ().split () input split cont = 0 cont 0 for i in t:
    for o in s:
        if i == o:
            cont +=1
            break i t for o in s:
        if i == o:
            cont +=1
            break o s if i == o:
            cont +=1
            break i == o i o cont +=1 cont 1 break print(cont) print cont s = input().split() input().split() s q = int(input()) int(input()) q t = input().split() input().split() t cont = 0 0 cont cont +=1 1 cont n = int(input()) int(input()) n
n = int(input())
s = input().split()
q = int(input())
t = input().split()
cont = 0
for i in t:
    for o in s:
        if i == o:
            cont +=1
            break

print(cont)