백준

백준 14425번: 문자열 집합 (파이썬)

inns21 2023. 7. 29. 23:03

n, m = map(int, input().split())
s = dict()
count = 0
for i in range(n+m):
  text = input()
  if i < n :
    s[text] = 0
  if i >= n and i < (n+m):
    if text in s.keys():
      count += 1
print(count)