#!/bin/python3 import sys def minimumNumber(n, password): num = False low = False upp = False sym = False numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" for c in password: if c in numbers: num = True elif c in lower_case: low = True elif c in upper_case: upp = True elif c in special_characters: sym = True count = 0 if not num: count += 1 if not low: count += 1 if not upp: count += 1 if not sym: count += 1 return(max(count,6-n)) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)