#include #include #include #include using namespace std; int main() { int minLength = 6; int minDigits = 1; int minUpperChars = 1; int minLowerChars = 1; vector specialChars = { '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '+'}; int n; cin >> n; string s; cin >> s; int length = s.length(); int countDigits = 0; int countUpperChars = 0; int countLowerChars = 0; int countSpecialChars = 0; for (int i = 0; i < s.length(); i++) { if (isdigit(s[i])) { countDigits++; } else if (isupper(s[i])) { countUpperChars++; } else if (islower(s[i])) { countLowerChars++; } else if (find(specialChars.begin(), specialChars.end(), s[i]) != specialChars.end()) { countSpecialChars++; } } int totalOp = 0; if (countDigits == 0) { totalOp++; } if (countUpperChars == 0) { totalOp++; } if (countLowerChars == 0) { totalOp++; } if (countSpecialChars == 0) { totalOp++; } if (length + totalOp < minLength) { totalOp += (minLength - (length + totalOp)); } cout << totalOp << endl; return 0; }