#!/bin/python import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): # Return the minimum number of characters to make the password strong #1 = int(len(set(numbers).intersection(password)))==0 + int(lower_case not in password) + int(special_characters not in password) x1 = int(len(set(numbers).intersection(set(password))) == 0) + int(len(set(special_characters).intersection(set(password))) == 0) + int(len(set(lower_case).intersection(set(password))) == 0) + int(len(set(upper_case).intersection(set(password))) == 0) x2 = max(0, 6 - n) return max(x1, x2) if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer