The British and American Style of Spelling

  • + 0 comments
    import re
    
    
    txt = ""
    for i in range(int(input())):
        txt +=" "+input()
    
    
    for j in range(int(input())):
        word = input()[:-2]
        print(len(re.findall(fr'{word}[zs]e',txt)))