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