#!/bin/python import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" is_number = False; is_lower = False; is_upper = False; is_special = False; rs = 0; for i in range(0,len(password)): if password[i] in numbers: is_number = True elif password[i] in lower_case: is_lower = True elif password[i] in upper_case: is_upper = True elif password[i] in special_characters: is_special = True if is_number and is_lower and is_upper and is_special: break; if not is_number: rs += 1 if not is_lower: rs += 1 if not is_upper: rs += 1 if not is_special: rs += 1 if n < 6: if 6-n < rs: return str(rs) return str(6-n) return str(rs) if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer