#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;
const int N = 20000;
char s[N];
int main() {
gets(s);
int t[4];
memset(t, 0, sizeof(t));
int len = strlen(s);
for (int i = 0; i < len; i++) {
int id = 3;
if (s[i] >= 'A' && s[i] <= 'Z') id = 0;
if (s[i] >= 'a' && s[i] <= 'z') id = 1;
if (s[i] >= '0' && s[i] <= '9') id = 2;
if (s[i] == ' ') id = 3;
t[id]++;
}
printf("%d %d %d %d\n", t[0], t[1], t[2], t[3]);
return 0;
}
/**************************************************************
Problem: 2224
User: admin
Language: C++
Result: Accepted
Time:60 ms
Memory:2096 kb
****************************************************************/