#!/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 leng = True digit = True lower = True upper = True special = True if n < 6: leng = False if not any([1 for x in password if x in numbers]): digit = False if not any([1 for x in password if x in lower_case]): lower = False if not any([1 for x in password if x in upper_case]): upper = False if not any([1 for x in password if x in special_characters]): special = False if leng: nec = sum([1 for x in [digit, lower, upper, special] if not x]) return nec else: nec = sum([1 for x in [digit, lower, upper, special] if not x]) if not nec+n >= 6: return nec + (6-(nec+n)) return nec if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer