#!/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 add = 0 if not(any([i in password for i in numbers])): add += 1 if not(any([i in password for i in lower_case])): add += 1 if not(any([i in password for i in upper_case])): add += 1 if not(any([i in password for i in special_characters])): add += 1 if n + add < 6: return 6 - n return add if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)