#include<stdio.h>
char pc = 0;
int eng;
int spc;
int num;
int oth;
int main(void)
{
while(pc != EOF)
{
pc = getchar() ;
if((pc>='A' && pc<='Z')||(pc>='a' && pc<='z'))
{
eng++;
}
else if(pc ==' ')
{
spc++;
}
else if(pc>='0' && pc<='9')
{
num++;
}
else
{
oth++;
//if(pc == '\0')
//oth--;
//printf("%c\n",pc);
}
}
printf("%d\n",eng);
printf("%d\n",spc);
printf("%d\n",num);
printf("%d\n",oth-2);
return 0;
}