#!/bin/python3 import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): hasUpper = False hasLower = False hasSpecial = False hasNumber = False for c in password: if not hasUpper and c in upper_case: hasUpper = True elif not hasLower and c in lower_case: hasLower = True elif not hasSpecial and c in special_characters: hasSpecial = True elif not hasNumber and c in numbers: hasNumber = True # Return the minimum number of characters to make the password strong missingChars = sum([0 if x else 1 for x in [hasUpper, hasLower, hasSpecial, hasNumber]]) return max(missingChars, 6 - n) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)