n = int(input()) wins = 0 for _ in range(n): k = input() if "CD" not in k: wins += 1 print(wins)