#include using namespace std; #define mxx 105 #define pii pair #define MP make_pair #define inf 1000000 #define ss second #define ff first #define DEBUG(x) cout << #x <<": " << x << endl string special_characters = "!@#$%^&*()-+"; int main() { int n; cin >> n; string s; cin >> s; int cnt = 0; for(int i = 0; i < s.size(); i++){ if(s[i] >= '0' && s[i] <= '9'){ cnt++; break; } } for(int i = 0;i < s.size(); i++){ if(s[i] >= 'a' && s[i] <= 'z'){ cnt++; break; } } for(int i = 0; i < s.size(); i++){ //cout << i << " " << s[i] << " " << uppercase[i] << endl; if(s[i] >= 'A' && s[i] <= 'Z'){ cnt++; break; } } int flag = 0; for(int i = 0; i < special_characters.size(); i++){ for(int j = 0; j < s.size(); j++){ if(s[j] == special_characters[i]){ cnt++; flag = 1; break; } } if(flag) break; } //DEBUG(cnt); //cout << cnt << endl; int res = 4 - cnt; int dif = 6 - (n + res); if(dif > 0) res += dif; cout << res << endl; }