n = int(eval(input()))

s = list(eval(input()))

import copy

M = 0

for i in range(n):

    count = 0

    l1 = copy.copy(s[0 : i + 1])

    l2 = copy.copy(s[i + 1 : n])

    l1 = list(set(l1))

    l2 = list(set(l2))

    for j in range(len(l1)):

        if l1[j] in l2:

            count += 1

    if count > M:

        M = count

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

s = eval(input())

l = list(s)

m = 0

for i in range(n - 1):

    l1 = l[:i+1]

    l2 = l[i+1:]

    l1 = list(set(l1))

    l2 = list(set(l2))

    l1.sort()

    l2.sort()

    x = 0

    for j in range(len(l1)):

        if l1[j] in l2:

            x += 1

    if x > m:

        m = x

print(m)

n = int(eval(input()))
s = list(eval(input()))
import copy

M = 0
for i in range(n):
    count = 0
    l1 = copy.copy(s[0 : i + 1])
    l2 = copy.copy(s[i + 1 : n])
    l1 = list(set(l1))
    l2 = list(set(l2))
    for j in range(len(l1)):
        if l1[j] in l2:
            count += 1
    if count > M:
        M = count
print((int(M)))

n = int(eval(input()))
s = eval(input())
l = list(s)
m = 0
for i in range(n - 1):
    l1 = l[: i + 1]
    l2 = l[i + 1 :]
    l1 = list(set(l1))
    l2 = list(set(l2))
    l1.sort()
    l2.sort()
    x = 0
    for j in range(len(l1)):
        if l1[j] in l2:
            x += 1
    if x > m:
        m = x
print(m)

-s = list(eval(input())) -import copy - -M = 0 -for i in range(n): -    count = 0 -    l1 = copy.copy(s[0 : i + 1]) -    l2 = copy.copy(s[i + 1 : n]) +s = eval(input()) +l = list(s) +m = 0 +for i in range(n - 1): +    l1 = l[: i + 1] +    l2 = l[i + 1 :] +    l1.sort() +    l2.sort() +    x = 0 -            count += 1 -    if count > M: -        M = count -print((int(M))) +            x += 1 +    if x > m: +        m = x +print(m)