class Solution:
def countWords(self, words1: List[str], words2: List[str]) -> int:
cnt1 = defaultdict(int)
cnt2 = defaultdict(int)
for w in words1:
cnt1[w] += 1
for w in words2:
cnt2[w] += 1
ans = 0
for w in cnt1.keys():
if cnt1[w] == 1 and cnt2[w] == 1:
ans += 1
return ans