#include<string.h>
#include<stdio.h>
int main()
{
char string[100];
int i,length,letter=0,number=0,space=0,others=0;
gets(string);
length = strlen(string);
for (i = 0; i < length; i++)
{
if (string[i] >= 'A'&&string[i] <= 'Z' || string[i] >= 'a'&&string[i] <= 'z')
letter += 1;
else if (string[i] >= '0'&&string[i] <= '9')
number += 1;
else if (string[i] == 32)
space += 1;
else
others += 1;
}
printf("%d %d %d %d", letter, number, space, others);
return 0;
}