n=int(eval(input()))

s=eval(input())

dic={}

for i in set(list(s)):

    if s.count(i)>1:

        dic[i]=s.count(i)

#print(dic)



d=0

for i in range(n-1):

    c=0

    x=s[:i+1]

    y=s[i+1:]

    if len(y)>len(x):

        for j in dic:

            if x.count(j)!=dic[j] and x.count(j)>0:

                c+=1

    else:

        for j in dic:

            if y.count(j)!=dic[j] and y.count(j)>0:

                c+=1

    if c>d:

        d=c

        #print(i)



print(d)

n=int(eval(input()))

s=eval(input())

ans=0

for i in range(n-1):

    s1=s[:i+1]

    s2=s[i+1:]

    s3=set(s1)&set(s2)

    ans=max(ans,len(s3))

print(ans)
n = int(eval(input()))
s = eval(input())
dic = {}
for i in set(list(s)):
    if s.count(i) > 1:
        dic[i] = s.count(i)
# print(dic)
d = 0
for i in range(n - 1):
    c = 0
    x = s[: i + 1]
    y = s[i + 1 :]
    if len(y) > len(x):
        for j in dic:
            if x.count(j) != dic[j] and x.count(j) > 0:
                c += 1
    else:
        for j in dic:
            if y.count(j) != dic[j] and y.count(j) > 0:
                c += 1
    if c > d:
        d = c
        # print(i)
print(d)

n = int(eval(input()))
s = eval(input())
ans = 0
for i in range(n - 1):
    s1 = s[: i + 1]
    s2 = s[i + 1 :]
    s3 = set(s1) & set(s2)
    ans = max(ans, len(s3))
print(ans)

-dic = {} -for i in set(list(s)): -    if s.count(i) > 1: -        dic[i] = s.count(i) -# print(dic) -d = 0 +ans = 0 -    c = 0 -    x = s[: i + 1] -    y = s[i + 1 :] -    if len(y) > len(x): -        for j in dic: -            if x.count(j) != dic[j] and x.count(j) > 0: -                c += 1 -    else: -        for j in dic: -            if y.count(j) != dic[j] and y.count(j) > 0: -                c += 1 -    if c > d: -        d = c -        # print(i) -print(d) +    s1 = s[: i + 1] +    s2 = s[i + 1 :] +    s3 = set(s1) & set(s2) +    ans = max(ans, len(s3)) +print(ans)