1both = {'a', 'A', 'b', 'B'}
2some = {'a', 'b', 'c'}
3result1 = both & some
4# result: {'a', 'b'}
5result2 = both.intersection(some)
6
7print(result1 == result2)
8# True
1# Enter your code here. Read input from STDIN. Print output to STDOUT
2num1, st1, num2, st2 = (set(input().split()) for i in range(4))
3print(len(st1.intersection(st2)))