from itertools import reduce n, readline = int(input()), lambda l: l.split() response = (readline(input()) for line in range(n)) NO = reduce(lambda a, b: a + b, map(lambda x: set(x[4]), filter(lambda x: x[4] == "NO", response))) YES = reduce(lambda a, b: a ^ b, map(lambda x: set(x[4]), filter(lambda x: x[4] == "YES", response))) print(45 - sum(NO + (NO ^ YES)))