#include <iostream>
#include <string>
using namespace std;

int main(int argc, char* argv[]){
    string str;
    getline(cin, str);
    int alpha = 0;
    int space = 0;
    int digit = 0;
    int other = 0;
    for(char c : str){
        if(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z'){
            ++alpha;
        }
        else if(c == ' '){
            ++space;
        }
        else if(c >= '0' && c <= '9'){
            ++digit;
        }
        else{
            ++other;
        }
    }

    cout << alpha << endl;
    cout << space << endl;
    cout << digit << endl;
    cout << other << endl;

    return 0;
}