import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        char[] chrs = scan.nextLine().toCharArray();
        int[] nums = new int[4];
        for (int i = 0; i < chrs.length; i++) {
            char chr = chrs[i];
            if ((chr >= 'a' && chr <= 'z') || (chr >= 'A' && chr <= 'Z')) {
                nums[0]++;
            } else if (chr == ' ') {
                nums[1]++;
            } else if (chr >= '0' && chr <= '9') {
                nums[2]++;
            } else {
                nums[3]++;
            }
        }
        for (int num : nums) {
            System.out.println(num);
        }
    }
}