#include #include #include #include #include #include using namespace std; char special[12] = {'!','@','#','$','%','^','&','*','(',')','-','+'}; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n; cin >> n; string in; cin >> in; bool check[5] = {0,}; check[0] = (n >= 6); for(int i = 0; i < n; ++i) { if(in[i] >= '0' && in[i] <= '9') check[1] = true; if(in[i] >= 'a' && in[i] <= 'z') check[2] = true; if(in[i] >= 'A' && in[i] <= 'Z') check[3] = true; for(int j = 0; j < 12; ++j) { if(in[i] == special[j]){ check[4] = true; } } } int answer = 0; for(int i = 1; i < 5; ++i) { if(!check[i]) answer++; } int len = in.length(); if(!check[0]) { answer = max(answer, 6 - len); } cout << answer; return 0; }