word_list = str.split(input())
ac = word_list.count('AC')
wa = word_list.count('WA')
tle = word_list.count('TLE')
re = word_list.count('RE')

print('AC x ',ac)
print('WA x ',wa)
print('TLE x ',tle)
print('RE x ',re)