#include <bits/stdc++.h>
using namespace std;

int main(){
    string m;
    int grand;
    while(getline(cin, m)){
        
        int alpha=0,kg=0,numb=0;
        
        for(int i=0;i<m.size();++i){
            if(isalpha(m[i])) alpha++;
            else if(m[i]==' ') kg++;
            else if(m[i]>='0'&&m[i]<='9') numb++;
        }
         cout<<alpha<<endl<<kg<<endl<<numb<<endl<<m.size()-alpha-kg-numb<<endl;     
    }
    return 0;
}