No Idea!

  • + 0 comments
    from collections import Counter
    
    _, arr, a, b = [input().split() for _ in range(4)]
    
    ainter = set(arr).intersection(set(a))
    binter = set(arr).intersection(set(b))
    
    carr = Counter(arr)
    
    pls = sum([carr[i] for i in ainter])
    minus = sum([carr[i] for i in binter])
    
    print(pls - minus)