#!/bin/python import sys numbers = "0123456789" lower_case = "abcdefghijklmnopqrstuvwxyz" upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" special_characters = "!@#$%^&*()-+" def minimumNumber(n, password): nums = False low = False up = False spec = False i = 0 while i < n and not (nums and low and up and spec): if password[i] in numbers: nums = True if password[i] in lower_case: low = True if password[i] in upper_case: up = True if password[i] in special_characters: spec = True i += 1 count = 0 if not nums: count += 1 if not low: count += 1 if not up: count += 1 if not spec: count += 1 if count + n < 6: return 6 - n return count # if not numbers, count +1 # if not lower, count +1 # if not spec, count +1 # length >= 6 # Return the minimum number of characters to make the password strong if __name__ == "__main__": n = int(raw_input().strip()) password = raw_input().strip() answer = minimumNumber(n, password) print answer