n=int(eval(input()))

s=eval(input())

t=""

k=""

ans=0

l=[]

for i in range(1,n):

    ans1=0

    t=sorted(set(s[:i]))

    k=sorted(set(s[i:]))

    for i in t:

        for j in k:

            if i==j:

                ans1+=1

            l.append(ans1)

print((max(l)))
n=int(eval(input()))

s=eval(input())

t=""

k=""

ans=0

l=[]

for i in range(1,n):

    ans1=0

    t=sorted(set(s[:i]))

    k=sorted(set(s[i:]))

    for i in t:

        for j in k:

            if i==j:

                ans1+=1

    l.append(ans1)

print((max(l)))
n = int(eval(input()))
s = eval(input())
t = ""
k = ""
ans = 0
l = []
for i in range(1, n):
    ans1 = 0
    t = sorted(set(s[:i]))
    k = sorted(set(s[i:]))
    for i in t:
        for j in k:
            if i == j:
                ans1 += 1
            l.append(ans1)
print((max(l)))

n = int(eval(input()))
s = eval(input())
t = ""
k = ""
ans = 0
l = []
for i in range(1, n):
    ans1 = 0
    t = sorted(set(s[:i]))
    k = sorted(set(s[i:]))
    for i in t:
        for j in k:
            if i == j:
                ans1 += 1
    l.append(ans1)
print((max(l)))

-            l.append(ans1) +    l.append(ans1)