#include<bits/stdc++.h>

using namespace std;

int main(){
    
    string str;
    while(getline(cin,str)){
        int a=0,kg=0,nums=0,other=0;
        for(auto c:str){
            if(isalpha(c))
                a++;
            else if(c==' ')
                kg++;
            else if(isalnum(c))
                nums++;
            else
                other++;
        }
        cout<<a<<'\n'<<kg<<'\n'<<nums<<'\n'<<other<<endl;
    }
    
    
    return 0;
}