#!/bin/python3 import sys def has_common_chars(s1, s2): return len(set(s1) & set(s2)) > 0 def minimumNumber(n, password): # Return the minimum number of characters to make the password strong checks = 4 sc = '!@#$%^&*()-+' s = password if (any(x.isupper() for x in s)): checks -= 1 if (any(x.islower() for x in s)): checks -= 1 if (any(x.isdigit() for x in s)): checks -= 1 if (has_common_chars(s,sc)>0): checks -= 1 if ((checks + len(s))<6): checks = checks + (6 - len(s) - checks) return checks if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)