#include <iostream>
#include <string>

int main() {
	std::string str;
	std::cin >> str;
	int y = 0;
	int e = 0;
	int a = 0;
	int h = 0;
	int b = 0;

	for (auto itr = str.begin(); itr != str.end(); itr++) {
		if (*itr == 'Y') y++;
		if (*itr == 'E') e++;
		if (*itr == 'A') a++;
		if (*itr == 'H') h++;
		if (*itr == '!') b++;
	}
	std::cout << y << ' ' << e << ' ' << a << ' ' << h << ' ' << b << std::endl;
	return 0;
}