#include #include #include #include #include using namespace std; //numbers = "0123456789" //lower_case = "abcdefghijklmnopqrstuvwxyz" //upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" //special_characters = "!@#$%^&*()-+" int main() { int n; string s; cin >> n >> s; auto special_characters = "!@#$%^&*()-+"s; bool has_number = false; bool has_lowercase = false; bool has_uppercase = false; bool has_special = false; for( auto c: s ) { if( c >= 'a' && c <= 'z' ) has_lowercase = true; if( c >= 'A' && c <= 'Z' ) has_uppercase = true; if( c >= '0' && c <= '9' ) has_number = true; if( special_characters.find(c) != string::npos ) has_special = true; } int m = 0; if( !has_lowercase ) ++m; if( !has_uppercase ) ++m; if( !has_number ) ++m; if( !has_special ) ++m; if( s.length() >= 6 ) { cout << m; } else { cout << max(6 - (int)s.length(), m); } }