n=int(input())
for i in range(n):
    if n = 'AC':
        print(n.count('AC'))
    elif n = 'WA':
        print(n.count('WA'))
    elif n = 'TLE':
        print(n.count('TLE'))
    elif n = 'RE':
        print(n.count('RE'))
