#!/bin/python3 import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong numbers = "0123456789" # Need one from here lower_case = "abcdefghijklmnopqrstuvwxyz" # Need one from here upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" # Need one from here special_characters = "!@#$%^&*()-+" # Need one from here min_num_to_add = 0 StrongFlags = [1, 1, 1, 1] if len(password) == 0: return 6 else: for c in password: if c in numbers: StrongFlags[0] = 0 elif c in lower_case: StrongFlags[1] = 0 elif c in upper_case: StrongFlags[2] = 0 elif c in special_characters: StrongFlags[3] = 0 if len(password) >= 6: return sum(StrongFlags) else: return max(sum(StrongFlags), 6 - len(password)) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)