# coding: utf-8
# linearSearch
def linear(n,s,key):
    s[n:] = [key]
    i = 0
    while s[i] != key:
        i += 1
    return i != n
n = int(input())
s = list(map(int,input().split()))
input()
t = list(map(int,input().split()))
cnt = 0
for i in t:
    if linear(n,s,i):
        cnt += 1
print(cnt) def linear(n,s,key):
    s[n:] = [key]
    i = 0
    while s[i] != key:
        i += 1
    return i != n linear s[n:] = [key] s[n:] s n: n [key] key i = 0 i 0 while s[i] != key:
        i += 1
     s[i] != key s[i] s i key i += 1 i 1 return i != n i != n i n n n s s 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 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 cnt = 0 cnt 0 for i in t:
    if linear(n,s,i):
        cnt += 1 i t if linear(n,s,i):
        cnt += 1 linear(n,s,i) linear n s i cnt += 1 cnt 1 print(cnt) print cnt def linear(n,s,key):
    s[n:] = [key]
    i = 0
    while s[i] != key:
        i += 1
    return i != n def linear(n,s,key):
    s[n:] = [key]
    i = 0
    while s[i] != key:
        i += 1
    return i != n linear n = int(input()) int(input()) n cnt = 0 0 cnt s = list(map(int,input().split())) list(map(int,input().split())) s t = list(map(int,input().split())) list(map(int,input().split())) t cnt += 1 1 cnt
# coding: utf-8
# linearSearch
def linear(n,s,key):
    s[n:] = [key]
    i = 0
    while s[i] != key:
        i += 1
    return i != n
n = int(input())
s = list(map(int,input().split()))
input()
t = list(map(int,input().split()))
cnt = 0
for i in t:
    if linear(n,s,i):
        cnt += 1
print(cnt)