#include<stdio.h>
int main(void)
{
char ch;
int space=0,num=0,cha=0,other=0;
ch=getchar();
while(ch!='\n'){
if(ch==' '){
space++;
}
else if(ch>='0'&&ch<='9'){
num++;
}
else if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')){
cha++;
}
else{
other++;
}
ch=getchar();
}
printf("%d %d %d %d",cha,num,space,other);
return 0;
}