#!/bin/python3 import sys import re def minimumNumber(n, password): # Return the minimum number of characters to make the password strong res = 0 if not re.search("\\d", password): res += 1 if not re.search("[a-z]", password): res += 1 if not re.search("[A-Z]", password): res += 1 if not re.search("\\W", password): res += 1 return res + max(0, 6-len(password)-res) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)