#include using namespace std; int minimumNumber(int n, string password) { // Return the minimum number of characters to make the password strong int cont = 0; if(n < 6) { cont = 6 - n; } int num = 0, lower = 0, upper = 0, special = 0; for(long long int i = 0 ; i< n ; i++) { if( password[i] >= '0' && password[i] <= '9' ) num = 1; if( password[i] >= 'a' && password[i] <= 'z' ) lower =1; if( password[i] >= 'A' && password[i] <= 'Z' ) upper =1; if( password[i] >= 33 && password[i] <= 45 ) special =1; } int count = 0; if(num == 0) { count++; } if(special == 0) { count++; } if(lower == 0) { count++; } if(upper == 0) { count++; } return max(count, cont); } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }