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