#include <stdio.h>
#include <ctype.h>
#define N 100
int
main(void)
{
char c;
int alpha = 0, num = 0, space = 0, other = 0;
while ((c=getchar())!='\n')
{
if (isalpha(c))
alpha++;
else if (isalnum(c))
num++;
else if (isspace(c))
space++;
else
other++;
}
printf("%d\n%d\n%d\n%d", alpha, num, space, other);
return 0;
}