#!/bin/python import sys def minimumNumber(n, password): numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" flag = 0 count = 0 length = len(password); for i in lower_case: if(i in password): flag = 1 break if(flag ==0): count +=1 flag = 0 for i in upper_case: if(i in password): flag = 1 break if(flag == 0): count +=1 flag = 0 for i in special_characters: if(i in password): flag = 1 break if(flag ==0): count +=1 flag = 0 for i in numbers: if(i in password): flag = 1 break if(flag ==0): count +=1 flag = 0 if(length + count >=6): return count else: return 6-(length) # Return the minimum number of characters to make the password strong if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer