#!/bin/python import sys def minimumNumber(n, password): numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" res = 0 if not any(map(lambda x: x in lower_case, password)): res = res + 1 if not any(map(lambda x: x in numbers, password)): res = res + 1 if not any(map(lambda x: x in upper_case, password)): res = res + 1 if not any(map(lambda x: x in special_characters, password)): res = res + 1 return res + max(0,(6 - (n + res))) if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer