#!/bin/python3 import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): tests = [False] * 4 req = 4 for c in password: if c in numbers and not tests[0]: tests[0] = True req -= 1 elif c in lower_case and not tests[1]: tests[1] = True req -= 1 elif c in upper_case and not tests[2]: tests[2] = True req -= 1 elif c in special_characters and not tests[3]: tests[3] = True req -= 1 minLen = 6 - len(password) if req > minLen: return req else: return minLen if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)