#include #include #include #include #define forever while(true) namespace Helper{ using LL = long long; const int MAXN = 1e5 + 1; const int MOD = 1e9 + 7; const LL lINF = 1e18 * 1LL; const int iINF = 1e9; template void PrintVector(std::vector v) { for (typename std::vector ::iterator it = v.begin(); it != v.end(); it++) { std::cout << *it << " "; } } template void addEdge(const T &v, const T &u, std::vector > &graph) { graph[v].push_back(u); graph[u].push_back(v); } auto Max = [](int &x, int &y) -> void { if (x < y) { x = y; }y = 0; }; }; int Dx[] = {0, 0, -1, 1}; int Dy[] = {1, -1, 0, 0}; bool cmp(const int &lhs, const int &rhs) { return lhs > rhs; } bool isDigit(const char &num) { return num >= '0' && num <= '9'; } bool isLetter(const char &ch) { return ch >= 'a' && ch <= 'z'; } bool isBig(const char &ch) { return ch >= 'A' && ch <= 'Z'; } int main() { std::ios::sync_with_stdio(false); int N; std::string S; std::cin >> N >> S; std::string str = "!@#$%^&*()-+"; int digit, letter, big, other = digit = letter = big = 0; for (int i = 0; i < S.size(); i++) { if (isDigit(S[i])) { digit = 1; } else if(isLetter(S[i])) { letter = 1; } else if(isBig(S[i])) { big = 1; } else { int cc = str.find(S[i]); if (cc > - 1) other = 1; } } int total = 0; if (!digit) total++; if (!letter) total++; if (!big) total++; if (!other) total++; if (N + total < 6) { std::cout << 6 - N; } else { std::cout << total; } return 0; }