c = 0 for _ in range(int(input())): s = input() arr = [] while s != "ВСЁ": arr.append(s) s = input() if "зайка" in arr: c += 1 print(c)