#include #include using namespace std; int main() { int n; scanf("%d", &n); string s; cin >> s; bool checked[5] = {false}; int sz = s.size(); if (sz > 5) checked[0] = true; for (int i = 0; i < sz; i++) { int x = s[i]; if (47 < x && x < 58) checked[1] = true; else if (64 < x && x < 91) checked[2] = true; else if (96 < x && x < 123) checked[3] = true; else checked[4] = true; } int sum = 0; for (bool v : checked) sum += (int) v; int t = 5 - sum; if (t <= 6 - sz) t = 6 - sz; if (t > 6 - sz) t = 5 - sum - 1; if (sz > 5) t = 5 - sum; printf("%d\n", t); return 0; }