#!/bin/python import sys def minimumNumber(n, password): counter = 0 charset = set() numbers = set(list("0123456789")) lower_case = set(list("abcdefghijklmnopqrstuvwxyz")) upper_case = set(list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")) special_characters = set(list("!@#$%^&*()-+")) numbers_b = False lower_case_b = False upper_case_b = False special_characters_b = False for charr in password: if charr in numbers: numbers_b = True if charr in lower_case: lower_case_b = True if charr in upper_case: upper_case_b = True if charr in special_characters: special_characters_b = True for boolean in [numbers_b,lower_case_b,upper_case_b,special_characters_b]: if boolean == False: counter += 1 return max(6 - n,counter) if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer