#!/bin/python import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong digit=0 uppercase=0 lowercase=0 special=0 numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" for a in range(0,n): if (password[a] in numbers): digit+=1 elif (password[a] in lower_case): lowercase+=1 elif (password[a] in upper_case): uppercase+=1 elif (password[a] in special_characters): special+=1 req=0 if digit<1: req+=1 if lowercase<1: req+=1 if uppercase<1: req+=1 if special<1: req+=1 length=req+len(password) if length<6: req=req+(6-length) return req if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer