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