#include
#include
int main()
{
int a=0,b=0,c=0,d=0,e=0,i;
char ch[20]={};
gets(ch);
for(i=0;ch[i]!=0;i++)
{
if(ch[i]>='A'&&ch[i]<='Z')
a+=1;
else if(ch[i]>='a'&&ch[i]枣基<='z')
b+=1;
else if(ch[i]==32)
c+=1;
else if(ch[i]>枣岩空='0'&&ch[i]凳瞎<='9')
d+=1;
else
e+=1;
}
printf("%d %d %d %d %d",a,b,c,d,e);
return 0;
}