#!/bin/python import sys import re def minimumNumber(n, password): if(n>=1 and n<=100): count=0 extra=0 if(n>=6): extra=0 else: extra=6-n if (re.match("[A-Z]",password)): count =count else: count=count+1 if (re.match("[a-z]",password)): count =count else: count=count+1 if (re.match("[0-9]",password)): count =count else: count=count+1 if ('!'or '@' or '#' or '$' or '%' or '^' or '&' or '*' or '(' or')' or '+' or '-') in password : count =count else: count=count+1 if extra>count: return extra else: return count # Return the minimum number of characters to make the password strong if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer