#!/bin/python3 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 hasDigit = False hasLower = False hasUpper = False hasSpecial = False for c in password: if hasDigit == False and c in numbers: hasDigit = True if hasLower == False and c in lower_case: hasLower = True if hasUpper == False and c in upper_case: hasUpper = True if hasSpecial == False and c in special_characters: hasSpecial = True if hasDigit and hasLower and hasUpper and hasSpecial: break res = 0 if hasDigit == False: res += 1 if hasLower == False: res += 1 if hasUpper == False: res += 1 if hasSpecial == False: res += 1 if n + res < 6: return 6 - n return res if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)