#include #include #include #include #include using namespace std; bool isspecial(char c) { static const char special[] = "!@#$%^&*()-+"; return find(begin(special), end(special), c) != end(special); } int strong(const string& s) { int need = !any_of(s.begin(), s.end(), isspecial) + !any_of(s.begin(), s.end(), [](char c) { return '0' <= c && c <= '9'; }) + !any_of(s.begin(), s.end(), [](char c) { return 'a' <= c && c <= 'z'; }) + !any_of(s.begin(), s.end(), [](char c) { return 'A' <= c && c <= 'Z'; }); return max(6 - (int)s.length(), need); } int main() { string s; int n; cin >> n >> s; cout << strong(s) << endl; return 0; }