#!/usr/bin/env python3 import collections # abcdefghijklmnopqrstuvwxyz # 4 3 2 1 _ = int(input()) cnt = collections.Counter() for c in input(): cnt[c] += 1 def take(c, z=None): if z is None: z = c while c <= z: if cnt[c]: cnt[c] -= 1 return c c = chr(ord(c) + 1) return '' def construct(s): acc = '' for c in s: if c.islower(): acc += take(c) elif c.isupper(): acc += take(c.lower(), 'z') if len(acc) < len(s): for c in acc: cnt[c] += 1 return False else: return True ans = 0 for s in [ 'yukiA', 'yukJ', 'yuL', 'yV', 'Z' ]: while construct(s): ans += 1 print(ans)