#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; int main(int argc, const char * argv[]) { string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; int n; cin >> n; string s; cin >> s; int c1 = 0, c2 = 0, c3 = 0, c4 = 0; for (int i = 0; i < n; ++i) { if (c1 == 0) for (int j = 0; j < numbers.length(); ++j){ if (s[i] == numbers[j]){ c1=1;break; } } if (c2 == 0) for (int j = 0; j < lower_case.length(); ++j){ if (s[i] == lower_case[j]){ c2 = 1;break; } } if (c3 == 0) for (int j = 0; j < upper_case.length(); ++j){ if (s[i] == upper_case[j]){ c3 = 1;break; } } if (c4 == 0) for (int j = 0; j < special_characters.length(); ++j){ if (s[i] == special_characters[j]){ c4 = 1;break; } } } int cnt = c1+c2+c3+c4; int res = 4-cnt; if (n+res < 6) res+=6-(n+res); cout << res; return 0; }