import sys
s=sys.stdin.readlines()
print(len(set(s[1].split())&set(s[3].split()))) import sys sys s=sys.stdin.readlines() s sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines print(len(set(s[1].split())&set(s[3].split()))) print len(set(s[1].split())&set(s[3].split())) len set(s[1].split())&set(s[3].split()) set(s[1].split()) set s[1].split() [1].split [1] s 1 split set(s[3].split()) set s[3].split() [3].split [3] s 3 split s=sys.stdin.readlines() sys.stdin.readlines() s
import sys
s=sys.stdin.readlines()
print(len(set(s[1].split())&set(s[3].split())))
