import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            int letterNum = 0,whitespaceNum = 0,digitNum = 0,otherNum = 0;
            String str = in.nextLine();
            for(Character ch : str.toCharArray()){
                if(Character.isLetter(ch)){
                    letterNum++;
                }else if(Character.isDigit(ch)){
                    digitNum++;
                }else if(Character.isWhitespace(ch)){
                    whitespaceNum++;
                }else{
                    otherNum++;
                }
            }
            System.out.println(letterNum);
            System.out.println(whitespaceNum);
            System.out.println(digitNum);
            System.out.println(otherNum);
        }
    }
}