arr = []
for _ in range(int(input())):
    arr += input().split()

c = 0
for s in arr:
    if s == "зайка":
        c += 1

print(c)