#!/bin/python3 import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): ncase = False lcase = False ucase = False scase = False for x in range(n): l = password[x] if l in numbers: ncase = True if l in lower_case: lcase = True if l in upper_case: ucase = True if l in special_characters: scase = True y = sum([1 for i in [ncase, lcase, ucase, scase] if not i]) if n + y >= 6: return y else: return 6 -n # Return the minimum number of characters to make the password strong if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)