#!/bin/python import sys def minimumNumber(n, password): 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 = ['!','@','#','$','%','^','&','*','(',')','-','+'] my_list = list(password) count = 0 if len(set(my_list).intersection(set(numbers))) == 0: count += 1 n += 1 if len(set(my_list).intersection(set(lower_case))) == 0: count += 1 n += 1 if len(set(my_list).intersection(set(upper_case))) == 0: count += 1 n += 1 if len(set(my_list).intersection(set(special_characters))) == 0: count += 1 n += 1 if n < 6: count += (6- n) return count if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer