import sys

n = int(sys.stdin.readline())
s = [int(x) for x in sys.stdin.readline().split()]
q = int(sys.stdin.readline())
t = [int(x) for x in sys.stdin.readline().split()]
cnt = 0

for i in t:
    if i in s:
        cnt += 1

print(cnt) import sys sys n = int(sys.stdin.readline()) n int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline int(x) for x in sys.stdin.readline().split() for x in sys.stdin.readline().split() x sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split for x in sys.stdin.readline().split() int(x) int x s = [int(x) for x in sys.stdin.readline().split()] s [int(x) for x in sys.stdin.readline().split()] q = int(sys.stdin.readline()) q int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline int(x) for x in sys.stdin.readline().split() for x in sys.stdin.readline().split() x sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split for x in sys.stdin.readline().split() int(x) int x t = [int(x) for x in sys.stdin.readline().split()] t [int(x) for x in sys.stdin.readline().split()] cnt = 0 cnt 0 for i in t:
    if i in s:
        cnt += 1 i t if i in s:
        cnt += 1 i in s i s cnt += 1 cnt 1 print(cnt) print cnt cnt = 0 0 cnt t = [int(x) for x in sys.stdin.readline().split()] [int(x) for x in sys.stdin.readline().split()] t s = [int(x) for x in sys.stdin.readline().split()] [int(x) for x in sys.stdin.readline().split()] s n = int(sys.stdin.readline()) int(sys.stdin.readline()) n cnt += 1 1 cnt q = int(sys.stdin.readline()) int(sys.stdin.readline()) q
import sys

n = int(sys.stdin.readline())
s = [int(x) for x in sys.stdin.readline().split()]
q = int(sys.stdin.readline())
t = [int(x) for x in sys.stdin.readline().split()]
cnt = 0

for i in t:
    if i in s:
        cnt += 1

print(cnt)