#include using namespace std; string s; int n; bool digit, lower, upper, special; char c[] = "!@#$%^&*()-+"; int main() { cin >> n; cin >> s; for (int i = 0; i < n; i++) { if ('0' <= s[i] && s[i] <= '9') { digit = true; } if ('a' <= s[i] && s[i] <= 'z') { lower = true; } if ('A' <= s[i] && s[i] <= 'Z') { upper = true; } for (int j = 0; j < 12; j++) { if (c[j] == s[i]) { special = true; } } } int ans = max(6 - n, !digit + !lower + !upper + !special); printf("%d\n", ans); return 0; }