d = { "Y" : 0, "E" : 1, "A" : 2, "H" : 3, "!" : 4 } s = input() v = [0] * 5 for i in s: v[d[i]] += 1 print(*v)