>>399
#include <iostream>
#include <string>
#include <functional>
#include <algorithm>

using namespace std;

int upper_num;
int lower_num;
int digit_num;

struct Counter : unary_function<char, void> {
    void operator () (char c) {
        if ('A' <= c && 'Z' >= c)
            ++upper_num;
        else if ('a' <= c && 'z' >= c)
            ++lower_num;
        else if ('0' <= c && '9' >= c)
            ++digit_num;
    }
};

int main() {
    string str;
    cin >> str;
    for_each(str.begin(), str.end(), Counter());
    cout << "upper: " << upper_num << endl;
    cout << "lower: " << lower_num << endl;
    cout << "digit: " << digit_num << endl;
}