#include <bits/stdc++.h>
using namespace std;
int l=0,n=0,o=0;
int main(){
	char c[50];
	for(int i=0;;i++){
		cin>>c[i];
		if(c[i]=='#')break;
		if(c[i]>='A'&&c[i]<='Z')o++;
		else if(c[i]>='a'&&c[i]<='z')l++;
		else n++;
	}
	cout<<o<<" "<<l<<" "<<n;
	return 0;
}

/**************************************************************
	Problem: 1097
	User: zhouhongyi
	Language: C++
	Result: Accepted
	Time:7 ms
	Memory:2072 kb
****************************************************************/