#include<iostream>
#include<string>
using namespace std;
int main()
{
    string str;
    while (getline(cin, str))
    {
        int a = 0, b = 0, c = 0, d = 0;
        for (auto i:str)
        {
            if (isalpha(i))a++;
            else if (isspace(i))b++;
            else if (isdigit(i))c++;
            else if (ispunct(i))d++;
        }
        cout << a << endl << b << endl << c << endl << d << endl;
    }
}