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