# Aizu Problem ALDS_1_4_A: Linear Search
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input2.txt", "rt")


_ = input()
S = set([int(_) for _ in input().split()])
_ = input()
T = set([int(_) for _ in input().split()])
print(len(S.intersection(T))) import sys, math, os sys math os PYDEV = os.environ.get('PYDEV') PYDEV os.environ.get('PYDEV') os.environ.get os.environ os environ get 'PYDEV' if PYDEV=="True":
    sys.stdin = open("sample-input2.txt", "rt") PYDEV=="True" PYDEV "True" sys.stdin = open("sample-input2.txt", "rt") sys.stdin sys stdin open("sample-input2.txt", "rt") open "sample-input2.txt" "rt" _ = input() _ input() input int(_) for _ in input().split() for _ in input().split() _ input().split() ().split () input split for _ in input().split() int(_) int _ S = set([int(_) for _ in input().split()]) S set([int(_) for _ in input().split()]) set [int(_) for _ in input().split()] _ = input() _ input() input int(_) for _ in input().split() for _ in input().split() _ input().split() ().split () input split for _ in input().split() int(_) int _ T = set([int(_) for _ in input().split()]) T set([int(_) for _ in input().split()]) set [int(_) for _ in input().split()] print(len(S.intersection(T))) print len(S.intersection(T)) len S.intersection(T) S.intersection S intersection T _ = input() input() _ _ = input() input() _ S = set([int(_) for _ in input().split()]) set([int(_) for _ in input().split()]) S PYDEV = os.environ.get('PYDEV') os.environ.get('PYDEV') PYDEV T = set([int(_) for _ in input().split()]) set([int(_) for _ in input().split()]) T
# Aizu Problem ALDS_1_4_A: Linear Search
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input2.txt", "rt")


_ = input()
S = set([int(_) for _ in input().split()])
_ = input()
T = set([int(_) for _ in input().split()])
print(len(S.intersection(T)))