#!/bin/python3 import sys numbers = {c for c in "0123456789"} lower_case = {c for c in "abcdefghijklmnopqrstuvwxyz"} upper_case = {c for c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ"} special_characters = {c for c in "!@#$%^&*()-+"} def contains_char(s1, s2): return len(s1 & s2) > 0 def minimumNumber(n, password): to_add = 0 pw_set = {p for p in password} for req_set in [numbers, lower_case, upper_case, special_characters]: if not contains_char(pw_set, req_set): to_add += 1 if len(password) >= 6: return to_add else: return max(6 - len(password), to_add) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)