import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        
            String str = in.nextLine();
            char[] ch = str.toCharArray();
            int word = 0;
            int num = 0;
            int space = 0;
            int other = 0;
            for(int i = 0;i < ch.length;i++){
                if((ch[i] >= 'a' && ch[i] <= 'z') || (ch[i] >= 'A' && ch[i] <= 'Z')){
                    word++;
                }else if(ch[i] >= '0' && ch[i] <= '9'){
                    num++;
                }else if(ch[i] == ' '){
                    space++;
                }else{
                    other++;
                }
            }
            System.out.println(word + "\n" + space + "\n" + num + "\n" + other);
        
    }
}