#include<stdio.h>
#include<string.h>
int main() {
char str[1001] = {'\0'};
while (gets(str)) {
int len = strlen(str);
int charac = 0, blank = 0, num = 0, other = 0;
for (int i = len - 1; i >= 0; i--) {
//字母计数(区分大小写)
if ((('a' <= str[i])&&(str[i] <= 'z')) || (('A' <= str[i])&&(str[i] <= 'Z'))) charac++;
else if (str[i] == ' ') blank++; //空格计数
else if (('0' <= str[i]) && (str[i] <= '9')) num++; //数字计数
else other++; //其他字符计数
}
printf("%d\n%d\n%d\n%d\n", charac, blank, num, other);
}
}