# Arup Guha
# 12/3/2023
# Solution to 2023 UCF HS Online D2 Problem: Anything Under the Sky

# Get # of items.
n = int(input())
res = 0

# Process input
for i in range(n):
    s = input().strip()

    # This is what we want to count.
    if s[:5] == "space":
        res += 1

# Ta da!
print(res)
