#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define scan(n) scanf("%d",&n) #define print(n) printf("%d",n) #define all(c) c.begin(),c.end() #define MAX 1e9+10 const int mod = 1000000007; #define ll long long #define pb push_back #define trace1(x) cerr << #x << " : " << x << endl; #define trace2(x, y) cerr << #x << " : " << x << " | " << #y << " : " << y << endl; #define trace3(x, y, z) cerr << #x << " : " << x << " | " << #y << " : " << y << " | " << #z << " : " << z << endl; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int test = 1; // cin >> test; while(test--) { int l; cin >> l; string s; cin >> s; string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; int count = 0; for(auto x: s) { if(numbers.find(x) != std::string::npos) { count++; break; } } for(auto x: s) { if(lower_case.find(x) != std::string::npos) { count++; break; } } for(auto x: s) { if(upper_case.find(x) != std::string::npos) { count++; break; } } for(auto x: s) { if(special_characters.find(x) != std::string::npos) { count++; break; } } //cout << count << endl; int newl = l + 4 - count; if(newl >= 6) cout << 4 - count << endl; else cout << 6 - newl + 4 - count << endl; } return 0; }