#include using namespace std; string speS = "!@#$^&*()-+"; // learn bool isSpe(char c) { if (c == '%') return true; for(auto cc : speS) if (c == cc) return true; return false; } int n; string s; int main() { cin >> n; cin >> s; int dit = 0, low = 0, up = 0, special = 0; for(auto c: s) { dit += c >= '0' && c <= '9'; low += c >= 'a' && c <= 'z'; up += c >= 'A' && c <= 'Z'; special += isSpe(c); } int ness = (dit == 0) + (low == 0) + (up == 0) + (special == 0); cout << max(ness, 6 - n); }