import numpy as np

n = int(eval(input()))

s = eval(input())



cnt = 0

for i in range(1,n):

  tmp = 0

  for a in set(list(s[:i])):

    tmp += max(np.sign(s[i:].find(a)+0.5),0)

  cnt = max(cnt,tmp)

print((int(cnt)))
n = int(eval(input()))

s = eval(input())



cnt = 0

for i in range(n):

  tmp = len(set(s[:i]).intersection(s[i:]))

  cnt = max(tmp,cnt)

print(cnt)
import numpy as np

n = int(eval(input()))
s = eval(input())
cnt = 0
for i in range(1, n):
    tmp = 0
    for a in set(list(s[:i])):
        tmp += max(np.sign(s[i:].find(a) + 0.5), 0)
    cnt = max(cnt, tmp)
print((int(cnt)))

n = int(eval(input()))
s = eval(input())
cnt = 0
for i in range(n):
    tmp = len(set(s[:i]).intersection(s[i:]))
    cnt = max(tmp, cnt)
print(cnt)

-import numpy as np - -for i in range(1, n): -    tmp = 0 -    for a in set(list(s[:i])): -        tmp += max(np.sign(s[i:].find(a) + 0.5), 0) -    cnt = max(cnt, tmp) -print((int(cnt))) +for i in range(n): +    tmp = len(set(s[:i]).intersection(s[i:])) +    cnt = max(tmp, cnt) +print(cnt)