#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned int UInt; #define ALL(a) (a).begin(), (a).end() #define FOR(i,a,b) for(int i = a, end = (int)(b) ; i < end; ++i) #define FOR_REV(i,a,b) for(int i = b-1, rend = (int)(a); i >= rend; --i) #define FOR_EACH(it,a) for(remove_reference::type::iterator it = (a).begin(); it != (a).end(); ++it) #define FOR_EACH_CONST(it,a) for(remove_reference::type::const_iterator it = (a).begin(); it != (a).end(); ++it) #define FOR_EACH_REV(it,a) for(remove_reference::type::reverse_iterator it = (a).rbegin(); it != (a).rend(); ++it) #define IN_INT(a) int a; is >> a; #define IN_INT2(a,b) int a,b; is >> a >> b; #define IN_INT3(a,b,c) int a,b,c; is >> a >> b >> c; template inline T sqr(T v) { return v * v; } template inline int sign(T v) {return v == 0 ? 0 : (v > 0 ? 1 : -1);} template int get_bit(T v, int bit_index) { return (v >> bit_index) & 1; } //return {0,1} istream& input() { ios_base::sync_with_stdio(false); //#undef INPUT_FROM_FILE #ifdef INPUT_FROM_FILE static ifstream is("HackerRank/input.txt"); #else istream& is = cin; #endif return is; } ostream& output() { cout << setprecision(15); return cout; } ///////////////////////////////////////////4/////////////////////////////// ////////////////////////////////////////////////////////////////////////// //b int main() { istream& is = input(); ostream& os = output(); IN_INT(n); string s; is>>s; string chars[4] = {"0123456789","abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ","!@#$%^&*()-+"}; vector need(4,1); FOR (i,0,s.size()) { FOR (j,0,4) if (need[j]) FOR_EACH (it,chars[j]) if (*it==s[i]) need[j]=0; } int add=0; FOR (j,0,4) if (need[j]) ++add; int res=max(6-n,add); os << res; return 0; } ////////////////////////////////////////////////////////////////////////// //int main() //{ // istream& is = input(); // ostream& os = output(); // // int t; // for (is >> t; t; --t) // { // int n; // is >> n; // vector a(n); // FOR (i,0,n) // is >> a[i]; // // //int res = 0; // //os << res; // os << "\n"; // } // return 0; //}