#!/bin/python3 import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def contains(s, symbols): for c in s: if c in symbols: return True return False def minimumNumber(n, s): res = 0 if not contains(s, numbers): res += 1 if not contains(s, lower_case): res += 1 if not contains(s, upper_case): res += 1 if not contains(s, special_characters): res += 1 if (len(s) + res) < 6: res += 6 - (len(s)+res) return res if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)