#include int main(void){int a=0,b=0,c=0,d=0;char ch;while(ch=getchar()){if(ch == '#')break;if(ch<='z'&&ch>='a')a++;else if(ch<='Z'&&ch>='A')b++;else if(ch<='0'&&ch>='9')c++;else d++;}printf("%d %d %d %d",a,b,c,d);}