#include <iostream>
using namespace std;
 
bool isspecial (char c) {
    return (c == '!' || c == '"' || c == '#' ||
            c == '$' || c == '%' || c == '&' || 
            c == '+' || c == '(' || c == ')'  ||
            c == '*' || c == '\'');
}
 
int main() {
    string password;
    cin >> password;
    bool test_lc, test_uc, test_dig, test_sp, 
    test_len = password.length() >= 8;
    int length = password.length();
    test_lc = test_uc = test_dig = test_sp = false;
    for (int i = 0; i < length; i++) {
        if (!test_lc) test_lc = islower(password[i]);
        if (!test_uc) test_uc = isupper(password[i]);
        if (!test_dig) test_dig = isdigit(password[i]);
        if (!test_sp) test_sp = isspecial(password[i]);
    }
    cout << test_len + test_lc + test_uc + test_dig + test_sp;
    return 0;
}