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