N = int(eval(input()))

S = eval(input())

s = set(S)

count = 0

maxx = 0

for i in range(N): #切断場所

    for k in range(i):

        if S[k] in S[:i] and S[k] in S[i:] and S[k] not in S[:k]:

            count += 1

    maxx = max(maxx, count)

    count = 0

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

S = eval(input())

print((max(len(set(S[:i])&set(S[i:])) for i in range(N))))
N = int(eval(input()))
S = eval(input())
s = set(S)
count = 0
maxx = 0
for i in range(N):  # 切断場所
    for k in range(i):
        if S[k] in S[:i] and S[k] in S[i:] and S[k] not in S[:k]:
            count += 1
    maxx = max(maxx, count)
    count = 0
print(maxx)

N = int(eval(input()))
S = eval(input())
print((max(len(set(S[:i]) & set(S[i:])) for i in range(N))))

-s = set(S) -count = 0 -maxx = 0 -for i in range(N):  # 切断場所 -    for k in range(i): -        if S[k] in S[:i] and S[k] in S[i:] and S[k] not in S[:k]: -            count += 1 -    maxx = max(maxx, count) -    count = 0 -print(maxx) +print((max(len(set(S[:i]) & set(S[i:])) for i in range(N))))