#!/bin/python3 import sys def minimumNumber(n, password): nums = list("0123456789") lower = list("abcdefghijklmnopqrstuvwxyz") upper = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") special = list("!@#$%^&*()-+") u = False l = False s = False n = False for i in password: if i in upper: u = True elif i in lower: l = True elif i in special: s = True elif i in nums: n = True ls = len(password) count = 0 if not u: count += 1 if not l: count += 1 if not s: count += 1 if not n: count += 1 diff = 0 if count + ls < 6: diff = 6-count-ls return count+diff if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)