#include<bits/stdc++.h>
using namespace std;
int main(){
char a[20];
int g=0,c=0,f=0;
gets(a);
for(int i=0;a[i]!='#';i++){
if(a[i]<='Z'&&a[i]>='A'){
g++;
}else if(a[i]<='z'&&a[i]>='a'){
c++;
}else{
f++;
}
}
cout<<g<<" "<<c<<" "<<f;
return 0;
}
/**************************************************************
Problem: 1097
User: wengsihan
Language: C++
Result: Accepted
Time:7 ms
Memory:2072 kb
****************************************************************/