#include #include #include #include #include #include #include #include #include //#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair pii; typedef pair pll; typedef vector vi; typedef vector vll; #define pb push_back templatevoid read(T &x) { register T c = getchar(); x = 0; int t = 0; if (c == '-') t = 1, c = getchar(); for (; (c < 48 || c > 57); c = getchar()); for (; c > 47 && c < 58; c = getchar()) { x = (x << 1) + (x << 3) + c - 48; } if (t) x = -x; } int main() { //ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin>>n; string s; cin>>s; bool arr[4]={0}; int count=0; for(int i=0;i='0' && s[i]<='9')arr[0]=1; else if(s[i]>='a' && s[i]<='z')arr[1]=1; else if(s[i]>='A' && s[i]<='Z')arr[2]=1; else arr[3]=1; } for(int i=0;i<4;i++)if(arr[i])count++; if(s.length()>=6)cout<<4-count; else { if((n+(4-count))>=6)cout<<4-count; else { int n=s.length(); n+=(4-count); cout<<(4-count)+6-n; } } }