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