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