#include using namespace std ; const int N = 100000 + 10 ; int main() { string special = "!@#$%^&*()-+" , str ; int n , len ; cin >> n >> str ; len = n ; int digit = 0 , lc = 0 , uc = 0 , sp = 0 ; for( int i = 0 ; i < special.size() ; i++ ) { for( int j = 0 ; j < len ; j++ ) { if( special[i] == str[j] ) { sp = 1 ; break ; } } } for( int i = 0 ; i < len ; i++ ) { if( isupper( str[i] ) ) uc = 1 ; if( islower( str[i] ) ) lc = 1 ; if( isdigit( str[i] ) ) digit = 1 ; } int must = ( sp == 0 ) + ( uc == 0 ) + ( lc == 0 ) + ( digit == 0 ) ; int newLen = len + must ; int ans = must ; if( newLen < 6 ) { ans += 6 - newLen ; } cout << ans << endl ; return 0 ; }