from collections import Counter



n = int(eval(input()))

s = list(str(eval(input())))

ans = 0





for i in range(n):

    count = 0

    cnt1 = Counter(s[0:i])

    cnt2 = Counter(s[i:n])

    l = []

    for k, j in list(cnt1.items()):

        l.append(k)

    for k, j in list(cnt2.items()):

        l.append(k)

    cnt3 = Counter(l)

    

    for k, j in list(cnt3.items()):

        if j == 2:

            count += 1

    ans = max(ans, count)



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

s = list(str(eval(input())))

ans = 0





for i in range(n):

    #print(set(s[0:i]), set(s[i:n]))

    ans = max(ans, len(set(s[0:i])&set(s[i:n])))



print(ans)
from collections import Counter

n = int(eval(input()))
s = list(str(eval(input())))
ans = 0
for i in range(n):
    count = 0
    cnt1 = Counter(s[0:i])
    cnt2 = Counter(s[i:n])
    l = []
    for k, j in list(cnt1.items()):
        l.append(k)
    for k, j in list(cnt2.items()):
        l.append(k)
    cnt3 = Counter(l)
    for k, j in list(cnt3.items()):
        if j == 2:
            count += 1
    ans = max(ans, count)
print(ans)

n = int(eval(input()))
s = list(str(eval(input())))
ans = 0
for i in range(n):
    # print(set(s[0:i]), set(s[i:n]))
    ans = max(ans, len(set(s[0:i]) & set(s[i:n])))
print(ans)

-from collections import Counter - -    count = 0 -    cnt1 = Counter(s[0:i]) -    cnt2 = Counter(s[i:n]) -    l = [] -    for k, j in list(cnt1.items()): -        l.append(k) -    for k, j in list(cnt2.items()): -        l.append(k) -    cnt3 = Counter(l) -    for k, j in list(cnt3.items()): -        if j == 2: -            count += 1 -    ans = max(ans, count) +    # print(set(s[0:i]), set(s[i:n])) +    ans = max(ans, len(set(s[0:i]) & set(s[i:n])))