#!/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 = "!@#$%^&*()-+" special = 4 if (any(elem in password for elem in numbers)): special -= 1 if (any(elem in password for elem in lower_case)): special -= 1 if (any(elem in password for elem in upper_case)): special -= 1 if (any(elem in password for elem in special_characters)): special -= 1 return(max(0 if len(password) > 6 else 6-len(password), special)) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)