#!/bin/python3 import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong ans = 0 t = {} d = 0 lc = 0 uc = 0 sc = 0 numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" for e in password : if e in numbers : d = d +1 if e in lower_case : lc += 1 if e in upper_case : uc = uc +1 if e in special_characters : sc += 1 if d == 0: ans += 1 n +=1 if uc == 0: ans += 1 n +=1 if lc == 0: ans += 1 n +=1 if sc == 0: ans += 1 n +=1 if n <6 : return (6 - n + ans) else : return ans if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)