#include <stdio.h>
#include <string.h>
int main()
{
char ch[14];
int i,w=0,s=0,n=0,e=0,t;
gets(ch);
t=strlen(ch);
for(i=0;i<=t;i++)
{
if(ch[i]>='a'&&ch[i]<='z'||ch[i]>='A'&&ch[i]<='Z')
w++;
else if(ch[i]==' ')
s++;
else if(ch[i]>='0'&&ch[i]<='9')
n++;
else
e++;
}
printf("%d %d %d %d",w,s,n,e-1);
return 0;
}