#!/bin/python import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): # Return the minimum number of characters to make the password strong if n >= 6: lenok=True else: lenok=False adding=6-n if set('1234567890').intersection(password): numok=True else: numok=False if set('ABCDEFGHIJKLMNOPQRSTUVWXYZ').intersection(password): upok=True else: upok=False if set('abcdefghijklmnopqrstuvwxyz').intersection(password): downok=True else: downok=False if set('!@#$%^&*()-+').intersection(password): spok=True else: spok=False output=0 if lenok==True: if numok==False: output+=1 if upok==False: output+=1 if downok==False: output+=1 if spok==False: output+=1 else: output=adding if numok==False: output-=1 if upok==False: output-=1 if downok==False: output-=1 if spok==False: output-=1 if output >= 0 : return adding else: output=-output return output+adding return output if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer