import java.util.Scanner;

public class CountAllKind {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        in.close();
        int Big = 0;
        int small = 0;
        int digtal = 0;

        for (int x = 0; x < str.length(); x++) {
            if (str.charAt(x) >= 'a' && str.charAt(x) <= 'z') {
                small++;
            }
            if (str.charAt(x) >= 'A' && str.charAt(x) <= 'Z') {
                Big++;
            }
            if (str.charAt(x) >= '0' && str.charAt(x) <= '9') {
                digtal++;
            }
        }
        System.out.println(Big);
        System.out.println(small);
        System.out.println(digtal);
    }
}
