#include typedef long long ll; using namespace std; bool tem(char c){ string s = "!@#$%^&*()-+"; for (int i = 0; i < s.size(); i++) if (s[i] == c) return true; return false; } int main(){ int n; string s; cin >> n; cin >> s; int q = 0; bool a = 0, b = 0, c = 0, d = 0; for (int i = 0; i < s.size(); i++){ if (isdigit(s[i])) a= true; if (islower(s[i])) b= true; if (isupper(s[i])) c= true; if (tem(s[i])) d = true; } q = !a + !b + !c + !d; int ans = max (6 - n, q); cout << ans << endl; return 0; }