import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
String s = sc.nextLine();
int[] res = new int[4];
for(int i = 0; i < s.length(); i++){
char c = s.charAt(i);
if(('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) res[0]++;
else if(c == ' ') res[1]++;
else if(('0' <= c && c <= '9')) res[2]++;
else res[3]++;
}
for(int i = 0; i < res.length; i++){
System.out.println(res[i]);
}
}
}