#include<stdio.h>
int main()
{
    char n;
    int alpha=0, kong=0, num=0, others=0;
    while(scanf("%c", &n) != EOF)
    {
        if((n>='a' && n<='z') || (n>='A' && n<='Z'))
            alpha++;
        else if(n == ' ')
            kong++;
        else if (n>='0' && n<='9')
            num++;
        else
            others++;
    }
    printf("%d\n%d\n%d\n%d\n", alpha, kong, num, others-1);
}