#include <iostream>
#include <cstring>
using namespace std;
bool isspecial (char c) {
return (c == '!' || c == '"' || c == '#' ||
c == '$' || c == '%' || c == '&' ||
c == '+' || c == '(' || c == ')' ||
c == '*' || c == '\'');
}
int main() {
char password[101];
cin >> password;
bool test_lc, test_uc, test_dig, test_sp,
test_len = strlen(password) >= 8;
int length = strlen(password);
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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIApib29sIGlzc3BlY2lhbCAoY2hhciBjKSB7CiAgcmV0dXJuIChjID09ICchJyB8fCBjID09ICciJyB8fCBjID09ICcjJyB8fAogICAgICBjID09ICckJyB8fCBjID09ICclJyB8fCBjID09ICcmJyB8fCAKICAgICAgYyA9PSAnKycgfHwgYyA9PSAnKCcgfHwgYyA9PSAnKScgIHx8CiAgICAgIGMgPT0gJyonIHx8IGMgPT0gJ1wnJyk7Cn0KIAppbnQgbWFpbigpIHsKICBjaGFyIHBhc3N3b3JkWzEwMV07CiAgY2luID4+IHBhc3N3b3JkOwogIGJvb2wgdGVzdF9sYywgdGVzdF91YywgdGVzdF9kaWcsIHRlc3Rfc3AsIAogIHRlc3RfbGVuID0gc3RybGVuKHBhc3N3b3JkKSA+PSA4OwogIGludCBsZW5ndGggPSBzdHJsZW4ocGFzc3dvcmQpOwogIHRlc3RfbGMgPSB0ZXN0X3VjID0gdGVzdF9kaWcgPSB0ZXN0X3NwID0gZmFsc2U7CiAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykgewogICAgaWYgKCF0ZXN0X2xjKSB0ZXN0X2xjID0gaXNsb3dl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