#!/bin/python import sys def minimumNumber(n, password): numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" # Return the minimum number of characters to make the password strong number, lower, upper, special = False, False, False, False result = 0 for c in password: if c in numbers: number = True elif c in lower_case: lower = True elif c in upper_case: upper = True elif c in special_characters: special = True if not number: result += 1 if not lower: result += 1 if not upper: result += 1 if not special: result += 1 if len(password) + result < 6: add = 6 - (len(password) + result) result += add return result if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer