#!/bin/python import sys import string numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): count =5 length=len(password) j=0 for i in password: if i in numbers: count-=1 break if count !=4: j+=1 count=5 for i in password: if i in lower_case: count-=1 break if count !=4: j+=1 count=5 for i in password: if i in upper_case: count-=1 break if count !=4: j+=1 count=5 for i in password: if i in special_characters: count-=1 break if count !=4: j+=1 count=5 ab=length+j if ab<6: return 6-ab+j else: return j # Return the minimum number of characters to make the password strong if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer