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