#!/bin/python3 import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): if n <= 3: return 6 - n nums = 1 lows = 1 ups = 1 sp = 1 for c in password: if c in numbers and nums > 0: nums -= 1 elif c in lower_case and lows > 0: lows -= 1 if c in upper_case and ups > 0: ups -= 1 if c in special_characters and sp > 0: sp -= 1 total_missing = nums + lows + ups + sp return max(total_missing, 6 - n) #return (6 - n) + (total_missing - (6 - n)) if n < 6 else total_missing if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)