#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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmJvb2wgaXNzcGVjaWFsIChjaGFyIGMpIHsKICAgIHJldHVybiAoYyA9PSAnIScgfHwgYyA9PSAnIicgfHwgYyA9PSAnIycgfHwKICAgICAgICAgICAgYyA9PSAnJCcgfHwgYyA9PSAnJScgfHwgYyA9PSAnJicgfHwgCiAgICAgICAgICAgIGMgPT0gJysnIHx8IGMgPT0gJygnIHx8IGMgPT0gJyknICB8fAogICAgICAgICAgICBjID09ICcqJyB8fCBjID09ICdcJycpOwp9CiAKaW50IG1haW4oKSB7CiAgICBzdHJpbmcgcGFzc3dvcmQ7CiAgICBjaW4gPj4gcGFzc3dvcmQ7CiAgICBib29sIHRlc3RfbGMsIHRlc3RfdWMsIHRlc3RfZGlnLCB0ZXN0X3NwLCAKICAgIHRlc3RfbGVuID0gcGFzc3dvcmQubGVuZ3RoKCkgPj0gODsKICAgIGludCBsZW5ndGggPSBwYXNzd29yZC5sZW5ndGgoKTsKICAgIHRlc3RfbGMgPSB0ZXN0X3VjID0gdGVzdF9kaWcgPSB0ZXN0X3NwID0gZmFsc2U7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKSB7CiAgICAgICAgaWYgKCF0ZXN0X2xjKSB0ZXN0X2xjID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