n,s = int(eval(input())),eval(input())

tmp=[]

for i in range(1,n):

  cnt = 0

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

    if j in list(set(s[i:])):

      cnt += 1

  tmp.append(cnt)

print((max(tmp)))
n,s = int(eval(input())),eval(input())

tmp=[]

for i in range(1,n):

  tmp.append(len(list(set(s[:i])&set(s[i:]))))

print((max(tmp)))
n, s = int(eval(input())), eval(input())
tmp = []
for i in range(1, n):
    cnt = 0
    for j in list(set(s[:i])):
        if j in list(set(s[i:])):
            cnt += 1
    tmp.append(cnt)
print((max(tmp)))

n, s = int(eval(input())), eval(input())
tmp = []
for i in range(1, n):
    tmp.append(len(list(set(s[:i]) & set(s[i:]))))
print((max(tmp)))

-    cnt = 0 -    for j in list(set(s[:i])): -        if j in list(set(s[i:])): -            cnt += 1 -    tmp.append(cnt) +    tmp.append(len(list(set(s[:i]) & set(s[i:]))))