while (input = readline()) {
    const arr = input.split('');
    let eng = 0;
    let space = 0; // 32
    let num = 0; //48-57
    let other = 0;

    for (let item of arr) {
        let code = item.charCodeAt();
        if (code >= 65 && code <= 90 || code >=97 && code <=122) {
            eng++;
        } else if (code == 32) {
            space++;
        } else if (code >= 48 && code <= 57) {
            num++;
        } else {
            other++;
        }
    }

    print(eng);
    print(space);
    print(num);
    print(other);
}