#include<bits/stdc++.h>
using namespace std;
int main()
{
    string str;
    while(getline(cin,str))
    {
        int a=0,b=0,c=0,d=0;
        for(auto x:str)
        {
            if((x>='a'&&x<='z')||(x>='A'&&x<='Z')) a+=1;
            else if(x==' ') b+=1;
            else if(x>='0'&&x<='9') c+=1;
            else d+=1;
        }
        cout<<a<<endl<<b<<endl<<c<<endl<<d<<endl;
    }
}