#!/bin/python3 import sys def minimumNumber(n, password): # Return the minimum number of characters to make the password strong sp = "!@#$%^&*()-+" num = 0; n = 0; if(len(password) < 6): num = 6 - len(password) if(not any(c.isupper() for c in password)): n += 1 if(not any(c.islower() for c in password)): n += 1 if(not any(c.isdigit() for c in password)): n += 1 if(not any((c in password) for c in sp)): n += 1 if(n > num): return n else: return num if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)