import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args) throws Exception{
Scanner sc = new Scanner(System.in);
while(sc.hasNextLine()){
String s = sc.nextLine();
char[] cc = s.toCharArray();
TreeMap<Integer, Integer> map = new TreeMap<>();
map.getOrDefault(1, 0);
map.getOrDefault(2, 0);
map.getOrDefault(3, 0);
map.getOrDefault(4, 0);
for(char c : cc){
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')){
map.put(1,map.getOrDefault(1,0) + 1);
}else if(c == ' '){
map.put(2,map.getOrDefault(2,0) + 1);
}else if(c >= '0' && c <= '9'){
map.put(3,map.getOrDefault(3,0) + 1);
}else{
map.put(4,map.getOrDefault(4,0) + 1);
}
}
for(int item = 1; item <= 4; ++item){
System.out.println(map.getOrDefault(item, 0));
}
}
}
}