n=int(eval(input()))

s=eval(input())

t=""

k=""

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())



ans = 0

for i in range(N):

    ans = max(ans, len(set(S[:i]) & set(S[i:])))

print(ans)

n = int(eval(input()))
s = eval(input())
t = ""
k = ""
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())
ans = 0
for i in range(N):
    ans = max(ans, len(set(S[:i]) & set(S[i:])))
print(ans)

-n = int(eval(input())) -s = eval(input()) -t = "" -k = "" -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()) +ans = 0 +for i in range(N): +    ans = max(ans, len(set(S[:i]) & set(S[i:]))) +print(ans)