#include #include #include #include #include #include int main() { std::string numbers = "0123456789"; std::string lower_case = "abcdefghijklmnopqrstuvwxyz"; std::string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; std::string special_characters = "!@#$%^&*()-+"; bool nms = false; bool lcs = false; bool ucs = false; bool scs = false; int n; std::cin >> n; std::string pass; std::cin >> pass; for(int i = 0; i < n; ++i) { for (int j = 0; j < numbers.size() && !nms; ++j) { if (pass[i] == numbers[j]) { nms = true; } } for (int j = 0; j < lower_case.size() && !lcs; ++j) { if (pass[i] == lower_case[j]) { lcs = true; } } for (int j = 0; j < upper_case.size() && !ucs; ++j) { if (pass[i] == upper_case[j]) { ucs = true; } } for (int j = 0; j < special_characters.size() && !scs; ++j) { if (pass[i] == special_characters[j]) { scs = true; } } } int sol = 0; if (!nms) { ++sol; } if (!lcs) { ++sol; } if (!ucs) { ++sol; } if (!scs) { ++sol; } if (n + sol < 6) { sol += (6 - (n + sol)); } std::cout << sol << std::endl; return 0; }