#!/bin/python3 import sys def minimumNumber(n, password): count = 0 n2=0; l=0; u=0; s=0; numbers = ['0','1','2','3','4','5','6','7','8','9'] lower_case = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] upper_case = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] special_characters = ['\'','!','@','#','$','%','^','&','*','(',')','-','+'] for x in password: if x in numbers and n2==0: n2=1 elif x in lower_case and l==0: l=1 elif x in upper_case and u==0: u=1 elif x in special_characters: s=1 if n2==0: count = count+1 if l==0: count = count+1 if u==0: count = count+1 if s==0: count = count+1 if n<6: if count < (6-n): count = 6-n return count if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)