import sys from string import ascii_lowercase, ascii_uppercase def minimumNumber(n, password): pw_set = set(password) n_x_chars = 0 if not pw_set & set(ascii_lowercase): n_x_chars += 1 if not pw_set & set(ascii_uppercase): n_x_chars += 1 if not pw_set & set("0123456789"): n_x_chars += 1 if not pw_set & set("!@#$%^&*()-+"): n_x_chars += 1 n_x_chars += max(6 - n - n_x_chars, 0) return n_x_chars if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)