#!/bin/python3 import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong nreqs = 0 hasNum = hasLC = hasUC = hasSC = False special_characters = list("!@#$%^&*()-+") for c in list(password): if c.isnumeric(): hasNum = True elif c.isalpha() and c.islower(): hasLC = True elif c.isalpha() and c.isupper(): hasUC = True elif c in special_characters: hasSC = True if hasNum is True: nreqs += 1 if hasLC is True: nreqs += 1 if hasUC is True: nreqs += 1 if hasSC is True: nreqs += 1 return max(4 - nreqs, 6 - len(password)) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)