#!/bin/python3 import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong length_req = 6 - n numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" strong_req = 4 - any(c in numbers for c in password) - any(c in lower_case for c in password) - any(c in upper_case for c in password) - any(c in special_characters for c in password) return max(strong_req, length_req) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)