• + 0 comments

    nyünyünyű vau:

    import re
    from collections import Counter
    
    word_regex = re.compile(r'[a-zA-Z0-9_]+')
    
    n = int(input())
    word_counter = Counter()
    for _ in range(n):
        word_counter.update(word_regex.findall(input()))
        
    t = int(input())
    for _ in range(t):
        print(word_counter[input()])