#!/bin/python import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): # Return the minimum number of characters to make the password strong passlen = len(password) hasnum = any(elem in password for elem in numbers) haslow = any(elem in password for elem in lower_case) hasup = any(elem in password for elem in upper_case) hasspec = any(elem in password for elem in special_characters) #print hasnum needed = 0 if not hasnum: needed += 1 if not haslow: needed += 1 if not hasup: needed += 1 if not hasspec: needed += 1 if passlen + needed < 6: return 6-passlen else: return needed if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer