#include<algorithm>
#include<stdio.h>
#include<string.h>
int main(){
char a[1000];
int numTotal=0,letterTotal=0,spaceTotal=0,otherTotal=0;
gets(a);
for(int i=0;i<strlen(a);i++){
if(a[i]>='0'&&a[i]<='9'){
numTotal++;
}
else if((a[i]>='a'&&a[i]<='z')||(a[i]>='A'&&a[i]<='Z')){
letterTotal++;
}
else if(a[i]==' '){
spaceTotal++;
}
else{
otherTotal++;
}
}
printf("%d %d %d %d",numTotal,letterTotal,spaceTotal,otherTotal);
}