<reponame>tomato-300yen/coding<filename>atcoder/abc/b029.py
S = [input() for _ in range(12)]
print(sum(map(lambda s: int("r" in s), S)))

S = [input() for _ in range(12)]
print(sum(map(lambda s: int("r" in s), S)))