import collections

N = int(eval(input()))

S = list(eval(input()))

m = 0

for i in range(1, N):

    A = S[:i]

    B = S[i:]

    m = max(m, len(collections.Counter(A))+len(collections.Counter(B)))

print((m - len(collections.Counter(S))))

N = int(eval(input()))

S = eval(input())

ans = 0

for i in range(1, N):

    x = set(S[:i])

    t_ans = 0

    for j in x:

        if j in S[i:]:

            t_ans += 1

    ans = max(t_ans, ans)

print(ans)

import collections

N = int(eval(input()))
S = list(eval(input()))
m = 0
for i in range(1, N):
    A = S[:i]
    B = S[i:]
    m = max(m, len(collections.Counter(A)) + len(collections.Counter(B)))
print((m - len(collections.Counter(S))))

N = int(eval(input()))
S = eval(input())
ans = 0
for i in range(1, N):
    x = set(S[:i])
    t_ans = 0
    for j in x:
        if j in S[i:]:
            t_ans += 1
    ans = max(t_ans, ans)
print(ans)

-import collections - -S = list(eval(input())) -m = 0 +S = eval(input()) +ans = 0 -    A = S[:i] -    B = S[i:] -    m = max(m, len(collections.Counter(A)) + len(collections.Counter(B))) -print((m - len(collections.Counter(S)))) +    x = set(S[:i]) +    t_ans = 0 +    for j in x: +        if j in S[i:]: +            t_ans += 1 +    ans = max(t_ans, ans) +print(ans)