#include using namespace std; string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string sc = "!@#$%^&*()-+"; int minimumNumber(int n, string p) { // Return the minimum number of characters to make the password strong int m[4]={},sm=0,i,j; for(i=0;i=65&&p[i]<=90)m[1]=1; if(p[i]>=97&&p[i]<=122)m[2]=1; if(p[i]>=48&&p[i]<=57)m[0]=1; for(j=0;j<12;j++)if(p[i]==sc[j])m[3]=1; } for(i=0;i<4;i++)sm+=m[i]; int rem = 4-sm; //n+=rem; //return ((n>=6)?0:(6-n)); if(sm==4&&n>=6)return 0; if(n>=6&&sm<4)return 4-sm; if(sm==4&&n<6)return 6-n; if(sm<4&&n<6){ rem=(4-sm); if(n+rem>=6)return rem; else return (6-(n)); //return (); } return 0; //return () } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }