#!/bin/python3 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 = "!@#$%^&*()-+" digit, lowercase, uppercase, special = 1, 1, 1, 1 for i in range(n): if password[i] in lower_case: lowercase = 0 elif password[i] in upper_case: uppercase = 0 elif password[i] in numbers: digit = 0 elif password[i] in special_characters: special = 0 if n < 6: return max(6 - n, lowercase + uppercase + digit + special) else: return lowercase + uppercase + digit + special if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)