#!/bin/python3 import sys numbers = "0123456789" lower = "abcdefghijklmnopqrstuvwxyz" upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special = "!@#$%^&*()-+" def minimumNumber(n, password): conditions = [1, 2, 3, 4] for index, value in enumerate(password): if value in numbers: try: conditions.remove(1) except ValueError: pass if value in lower: try: conditions.remove(2) except ValueError: pass if value in upper: try: conditions.remove(3) except ValueError: pass if value in special: try: conditions.remove(4) except ValueError: pass result = len(conditions) current_length = len(password) + len(conditions) required_length = 6 difference = required_length - current_length if difference > 0: result += difference return (result) # Return the minimum number of characters to make the password strong if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)