N = int(eval(input()))

S = eval(input())



sets = set(S)

ans = 0

for i in range(1,N):

    cnt = 0

    for s in sets:

        l = 0

        r = 0

        for j in S[:i]:

            if j ==s :

                l=1

                break

        for j in S[i:N]:    

            if j == s  :  

                r=1

                break

        if l*r == 1:

            cnt += 1

    ans = max(ans,cnt)

    

print(ans)
N = int(eval(input()))

S = list(eval(input()))

#%%

ans= 0

for i in range(1,N):

    set1 = set()

    set2 = set()

    

    for s in S[:i]:

        set1.add(s)

    for s in S[i:]:

        set2.add(s)

    

    sets = set1 & set2

    ans = max(ans,len(list(sets)))



print(ans)

    

    

    

    
N = int(eval(input()))
S = eval(input())
sets = set(S)
ans = 0
for i in range(1, N):
    cnt = 0
    for s in sets:
        l = 0
        r = 0
        for j in S[:i]:
            if j == s:
                l = 1
                break
        for j in S[i:N]:
            if j == s:
                r = 1
                break
        if l * r == 1:
            cnt += 1
    ans = max(ans, cnt)
print(ans)

N = int(eval(input()))
S = list(eval(input()))
#%%
ans = 0
for i in range(1, N):
    set1 = set()
    set2 = set()
    for s in S[:i]:
        set1.add(s)
    for s in S[i:]:
        set2.add(s)
    sets = set1 & set2
    ans = max(ans, len(list(sets)))
print(ans)

-S = eval(input()) -sets = set(S) +S = list(eval(input())) +#%% -    cnt = 0 -    for s in sets: -        l = 0 -        r = 0 -        for j in S[:i]: -            if j == s: -                l = 1 -                break -        for j in S[i:N]: -            if j == s: -                r = 1 -                break -        if l * r == 1: -            cnt += 1 -    ans = max(ans, cnt) +    set1 = set() +    set2 = set() +    for s in S[:i]: +        set1.add(s) +    for s in S[i:]: +        set2.add(s) +    sets = set1 & set2 +    ans = max(ans, len(list(sets)))