#!/bin/python import sys import re def minimumNumber(n, password): # Return the minimum number of characters to make the password strong #n = number of char count=0 min = None if n==0: return 6 if n==1: return 5 if n==2: return 4 if n < 7: min = 6-n digit = re.search(r"\d", password) uppercase = re.search(r"[A-Z]", password) lowercase = re.search(r"[a-z]", password) symbol = re.search(r"[!@#$+%\-^&*()]", password) if not digit: count+=1 if not uppercase: count+=1 if not lowercase: count+=1 if not symbol: count+=1 if min and count < min: return min return count if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer