import sys

n = int(sys.stdin.readline().strip())
S = map(int, sys.stdin.readline().strip().split(" "))

n = int(sys.stdin.readline().strip())
T = map(int, sys.stdin.readline().strip().split(" "))

res = []

for t in T:
    res.append(int(S.count(t) != 0))
print sum(res) import sys sys n = int(sys.stdin.readline().strip()) n int(sys.stdin.readline().strip()) int sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip S = map(int, sys.stdin.readline().strip().split(" ")) S map(int, sys.stdin.readline().strip().split(" ")) map int sys.stdin.readline().strip().split(" ") sys.stdin.readline().strip().split sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip split " " n = int(sys.stdin.readline().strip()) n int(sys.stdin.readline().strip()) int sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip T = map(int, sys.stdin.readline().strip().split(" ")) T map(int, sys.stdin.readline().strip().split(" ")) map int sys.stdin.readline().strip().split(" ") sys.stdin.readline().strip().split sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip split " " res = [] res [] for t in T:
    res.append(int(S.count(t) != 0)) t T res.append(int(S.count(t) != 0)) res.append res append int(S.count(t) != 0) int S.count(t) != 0 S.count(t) S.count S count t 0 print sum(res) sum res n = int(sys.stdin.readline().strip()) int(sys.stdin.readline().strip()) n S = map(int, sys.stdin.readline().strip().split(" ")) map(int, sys.stdin.readline().strip().split(" ")) S T = map(int, sys.stdin.readline().strip().split(" ")) map(int, sys.stdin.readline().strip().split(" ")) T res = [] [] res n = int(sys.stdin.readline().strip()) int(sys.stdin.readline().strip()) n
import sys

n = int(sys.stdin.readline().strip())
S = map(int, sys.stdin.readline().strip().split(" "))

n = int(sys.stdin.readline().strip())
T = map(int, sys.stdin.readline().strip().split(" "))

res = []

for t in T:
    res.append(int(S.count(t) != 0))
print sum(res)