n = int(eval(input()))

s = eval(input())



s = list(s)

ans = 0

count = 0



for a in range(1, n):

    l1 = list(set(s[:a]))

    l2 = list(set(s[a:]))



    length1 = len(l1)



    for x in range(length1):

        if l1[x] in l2:

            count += 1

    ans = max(ans, count)

    count = 0



print(ans)

n = int(eval(input()))

s = eval(input())



s = list(s)

ans = 0

count = 0



for a in range(1, n):

    l1 = list(set(s[:a]))

    l2 = set(s[a:])



    length1 = len(l1)



    for x in range(length1):

        if l1[x] in l2:

            count += 1

    ans = max(ans, count)

    count = 0



print(ans)

n = int(eval(input()))
s = eval(input())
s = list(s)
ans = 0
count = 0
for a in range(1, n):
    l1 = list(set(s[:a]))
    l2 = list(set(s[a:]))
    length1 = len(l1)
    for x in range(length1):
        if l1[x] in l2:
            count += 1
    ans = max(ans, count)
    count = 0
print(ans)

n = int(eval(input()))
s = eval(input())
s = list(s)
ans = 0
count = 0
for a in range(1, n):
    l1 = list(set(s[:a]))
    l2 = set(s[a:])
    length1 = len(l1)
    for x in range(length1):
        if l1[x] in l2:
            count += 1
    ans = max(ans, count)
    count = 0
print(ans)

-    l2 = list(set(s[a:])) +    l2 = set(s[a:])