#!/bin/python3 import sys 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 = "!@#$%^&*()-+" changes = 0 sc_ok = False for i in special_characters: if(i in password): sc_ok = True break if(not sc_ok): password += "!" changes += 1 upp_ok = False for i in upper_case: if(i in password): upp_ok = True break if(not upp_ok): password += "A" changes += 1 low_ok = False for i in lower_case: if(i in password): low_ok = True break if(not low_ok): password += "a" changes += 1 dig_ok = False for i in numbers: if(i in password): dig_ok = True break if(not dig_ok): password += "0" changes += 1 length = len(password) if(length < 6): changes += (6 - length) return changes if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)