#include <stdarg.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string.h>
#include <algorithm>
#include <stdlib.h>
#include <memory>
#include <string.h>
#include <set>
#include <map>
#include <sstream>
#include <string>
using namespace std;
/* 求英文字母的大小*/
static int getEnglishCharCount(string str)
{
int len = str.size();
int i = 0;
int count = 0;
for (i = 0; i < len; i++)
{
if ((str[i] >= 'a' && str[i] <= 'z') || (str[i] >= 'A' && str[i] <= 'Z'))
{
++count;
}
}
return count;
}
/* 求空格字符的个数 */
static int getBlankCharCount(string str)
{
int len = str.size();
int i = 0;
int count = 0;
for (i = 0; i < len; i++)
{
if (str[i] == ' ')
{
++count;
}
}
return count;
}
/* 求数字字符的个数 */
static int getNumberCharCount(string str)
{
int len = str.size();
int i = 0;
int count = 0;
for (i = 0; i < len; i++)
{
if (str[i] >= '0' && str[i] <= '9')
{
++count;
}
}
return count;
}
/* 统计出其它字符的个数 */
static int getOtherCharCount(string str)
{
int count = str.size() - getEnglishCharCount(str);
count = count - getBlankCharCount(str);
count = count - getNumberCharCount(str);
return count;
}
int main()
{
string str;
getline(cin, str);
cout << getEnglishCharCount(str) << endl;
cout << getBlankCharCount(str) << endl;
cout << getNumberCharCount(str) << endl;
cout << getOtherCharCount(str) << endl;
return 0;
}