#include<iostream>
using namespace std;
int main()
{
char c;
int big_letter=0,small_letter=0,digit=0,other=0;
while((c=getchar())!='\n')
{
if(c>='A'&&c<='Z'){
big_letter++;
}else if(c>='a'&&c<='z'){
small_letter++;
}else if(c>='0'&&c<='9'){
digit++;
}else if(c==' '){
other++;
}
else{
other++;
}
}cout << big_letter << " " << small_letter << " " << digit << " " << other << endl;
return 0;
}