#!/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 = "!@#$%^&*()-+" passw = password.replace(' ',"") lp = len(passw) if lp<=0: return 6 isD = False isU = False isL = False isS = False for i in range(len(passw)): if passw[i] in numbers: isD = True if passw[i] in upper_case: isU = True if passw[i] in lower_case: isL = True if passw[i] in special_characters: isS = True if (not isD) and (not isU) and (not isL) and (not isS): lp = lp - 1 ans = 0 if not isD: ans += 1 if not isU: ans += 1 if not isL: ans += 1 if not isS: ans += 1 res = max(ans, 6-lp) return res if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)