#!/bin/python3 import sys import re 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 if not any((c in numbers) for c in password): count = count + 1 if not any((c in lower_case) for c in password): count = count + 1 if not any((c in upper_case) for c in password): count = count + 1 if not any((c in special_characters) for c in password): count = count + 1 if (n + count) >= 6: return count else: return 6-n if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)