• + 1 comment

    Here's mine

    s = [input() for _ in range(int(input()))] 
    for _ in range(int(input())):
        print(s.count(input()))