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