import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int letter = 0;
        int space = 0;
        int digit = 0;
        int other = 0;
        for (char c : line.toCharArray()) {
            if (Character.isLetter(c)) {
                letter++;
            } else if (Character.isSpaceChar(c)) {
                space++;
            } else if (Character.isDigit(c)) {
                digit++;
            } else {
                other++;
            }
        }
        System.out.println(letter);
        System.out.println(space);
        System.out.println(digit);
        System.out.println(other);
    }
}