import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        int z = 0;
        int k = 0;
        int sz = 0;
        int o = 0;
        for(int i = 0; i<s.length(); i++){
            if((s.charAt(i)>='a' && s.charAt(i)<='z') || (s.charAt(i)>='A' && s.charAt(i)<='Z')){
                z++;
            }else if(s.charAt(i)==' '){
                k++;
            }else if(s.charAt(i)>='0' && s.charAt(i)<='9'){
                sz++;
            }else{
                o++;
            }
        }
        System.out.println(z);
        System.out.println(k);
        System.out.println(sz);
        System.out.println(o);
    }
}