import java.util.Scanner;

/**
 * HJ40 统计字符
 */
public class HJ040 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String str = sc.nextLine();
            String s1 = str.replaceAll("[A-Z]+|[a-z]+", "");
            System.out.println(str.length() - s1.length());
            String s2 = s1.replaceAll(" ", "");
            System.out.println(s1.length() - s2.length());
            String s3 = s2.replaceAll("[0-9]+", "");
            System.out.println(s2.length() - s3.length() + "\n" + s3.length());
        }
        sc.close();
    }

}