#include using namespace std; int n; char s[110]; char special[] = {'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-' }; bool Find(char x) { for (int i = 0;i <= 10;++i) if (x == special[i]) return true; return false; } int main() { ios_base::sync_with_stdio(false); cin >> n; int ans = 0; bool digit = false; bool lowercase = false; bool uppercase = false; bool ch = false; bool dim = false; char c; for (int i = 1;i <= n;++i) { cin >> c; if ('a' <= c && c <= 'z') lowercase = true; if ('A' <= c && c <= 'Z') uppercase = true; if (Find(c)) ch = true; if ('0' <= c && c <= '9') digit = true; } if (lowercase == false) { ++ans; ++n; } if (uppercase == false) { ++ans; ++n; } if (digit == false) { ++ans; ++n; } if (ch == false) { ++ans; ++n; } if (n < 6) { ans += 6 - n; } cout << ans << "\n"; return 0; }