#include using namespace std; int minimumNumber(int n, string s ) { string ns= "0123456789" ; string low = "abcdefghijklmnopqrstuvwxyz" ; string up = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; string spe = "!@#$%^&*()-+" ; unordered_set a,b,c,d ; int u,v,w,x,y,z, r ; w = x = y = z = 0 ; r = 0 ; for( auto x : ns ) a.insert( x ) ; for( auto x : low ) b.insert( x ) ; for( auto x : up ) c.insert( x ) ; for( auto x : spe ) d.insert( x ) ; for( auto l : s ){ if( a.count(l) ) w ++ ; if( b.count(l) ) x ++ ; if( c.count(l) ) y ++ ; if( d.count(l) ) z ++ ; } if( !w ) r ++ ; if( !x ) r ++ ; if( !y ) r ++ ; if( !z ) r ++ ; if( n + r < 6 ) r += ( 6-r-n ); return r ; } int main() { int n; cin >> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }