# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_A
# Linear Search
# Result:
import sys


### main
ary_s_len = int(sys.stdin.readline().rstrip())
ary_s = [int(x) for x in sys.stdin.readline().rstrip().split(' ')]
ary_t_len = int(sys.stdin.readline().rstrip())
ary_t = [int(x) for x in sys.stdin.readline().rstrip().split(' ')]
assert len(ary_s) == ary_s_len
assert len(ary_t) == ary_t_len

count = 0
for e in ary_t:
    for se in ary_s:
        if e == se:
            count += 1
            break

print count import sys sys ary_s_len = int(sys.stdin.readline().rstrip()) ary_s_len int(sys.stdin.readline().rstrip()) int sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip int(x) for x in sys.stdin.readline().rstrip().split(' ') for x in sys.stdin.readline().rstrip().split(' ') x sys.stdin.readline().rstrip().split(' ') sys.stdin.readline().rstrip().split sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip split ' ' for x in sys.stdin.readline().rstrip().split(' ') int(x) int x ary_s = [int(x) for x in sys.stdin.readline().rstrip().split(' ')] ary_s [int(x) for x in sys.stdin.readline().rstrip().split(' ')] ary_t_len = int(sys.stdin.readline().rstrip()) ary_t_len int(sys.stdin.readline().rstrip()) int sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip int(x) for x in sys.stdin.readline().rstrip().split(' ') for x in sys.stdin.readline().rstrip().split(' ') x sys.stdin.readline().rstrip().split(' ') sys.stdin.readline().rstrip().split sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip split ' ' for x in sys.stdin.readline().rstrip().split(' ') int(x) int x ary_t = [int(x) for x in sys.stdin.readline().rstrip().split(' ')] ary_t [int(x) for x in sys.stdin.readline().rstrip().split(' ')] assert len(ary_s) == ary_s_len len(ary_s) == ary_s_len len(ary_s) len ary_s ary_s_len assert len(ary_t) == ary_t_len len(ary_t) == ary_t_len len(ary_t) len ary_t ary_t_len count = 0 count 0 for e in ary_t:
    for se in ary_s:
        if e == se:
            count += 1
            break e ary_t for se in ary_s:
        if e == se:
            count += 1
            break se ary_s if e == se:
            count += 1
            break e == se e se count += 1 count 1 break print ary_s = [int(x) for x in sys.stdin.readline().rstrip().split(' ')] [int(x) for x in sys.stdin.readline().rstrip().split(' ')] ary_s count = 0 0 count ary_t_len = int(sys.stdin.readline().rstrip()) int(sys.stdin.readline().rstrip()) ary_t_len count += 1 1 count ary_t = [int(x) for x in sys.stdin.readline().rstrip().split(' ')] [int(x) for x in sys.stdin.readline().rstrip().split(' ')] ary_t ary_s_len = int(sys.stdin.readline().rstrip()) int(sys.stdin.readline().rstrip()) ary_s_len
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_A
# Linear Search
# Result:
import sys


### main
ary_s_len = int(sys.stdin.readline().rstrip())
ary_s = [int(x) for x in sys.stdin.readline().rstrip().split(' ')]
ary_t_len = int(sys.stdin.readline().rstrip())
ary_t = [int(x) for x in sys.stdin.readline().rstrip().split(' ')]
assert len(ary_s) == ary_s_len
assert len(ary_t) == ary_t_len

count = 0
for e in ary_t:
    for se in ary_s:
        if e == se:
            count += 1
            break

print count