#!/bin/python3 import sys def minimumNumber(n, password): res = list(password) inc = 0 special = '!@#$%^&*()-+' smal = 'abcdefghijklmnopqrstuvwxyz' uper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' num = '0123456789' chk = False for i in special: if i in res: chk = True break if not chk: inc = inc + 1 chk = False for i in smal: if i in res: chk = True break if not chk: inc = inc + 1 chk = False for i in uper: if i in res: chk = True break if not chk: inc = inc + 1 chk = False for i in num: if i in res: chk = True break if not chk: inc = inc + 1 if inc + n >= 6: return inc else: p = 6 - (n + inc) return (p + inc) if __name__ == "__main__": n = int(input().strip()) password = input().strip() answer = minimumNumber(n, password) print(answer)