#include #include #include #include #include #include using namespace std; int main() { int n, left = 4; string str; cin >> n >> str; string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; bool hasN = 0, hasL = 0, hasU = 0, hasS = 0; for (int i = 0; i < str.length() && !(hasN && hasL && hasU && hasS); ++i) { if (!hasN) hasN = numbers.find(str[i]) != string::npos; if (!hasL) hasL = lower_case.find(str[i]) != string::npos; if (!hasU) hasU = upper_case.find(str[i]) != string::npos; if (!hasS) hasS = special_characters.find(str[i]) != string::npos; } left = left - hasN - hasL - hasU - hasS; cout << max(6 - n, left); return 0; }