#include<string>
#include<iostream>
using namespace std;
int main()
string a;
int y=0,k=0,5=0,0=0;
getline(cin,a);
for(int i=0;i<a.length();i++)
if(a[i]>='A'&&a[i]<='Z')
++y;
elseif(a[i]>='a'&8a[i]<='z')++y;
elseif(a[i]>='0'88a[i]<='9')
++s;
elseif(a[i]==' ')
++k;
else ++o;
}
cout<<y<<""<<k<<" "<<s<<""<<o<<endl;
}