n = int(eval(input()))

s = eval(input())

num = 0

for i in range(len(s)):

    t1 = s[:i]

    t2 = s[i:]

    rec = 0

    rec1 = []

    for j in range(len(s)):

        if s[j] in t1 and s[j] in t2 and s[j] not in rec1:

            rec += 1

            rec1.append(s[j])



    num = max(num, rec)

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

s = eval(input())

num = 0

for i in range(1, n):

    q = s[:i]

    p = s[i:]

    tmp1 = set()

    for j in q:

        tmp1.add(j)

    tmp2 = set()

    for j in p:

        tmp2.add(j)



    num = max(num, len(tmp1 & tmp2))



print(num)

n = int(eval(input()))
s = eval(input())
num = 0
for i in range(len(s)):
    t1 = s[:i]
    t2 = s[i:]
    rec = 0
    rec1 = []
    for j in range(len(s)):
        if s[j] in t1 and s[j] in t2 and s[j] not in rec1:
            rec += 1
            rec1.append(s[j])
    num = max(num, rec)
print(num)

n = int(eval(input()))
s = eval(input())
num = 0
for i in range(1, n):
    q = s[:i]
    p = s[i:]
    tmp1 = set()
    for j in q:
        tmp1.add(j)
    tmp2 = set()
    for j in p:
        tmp2.add(j)
    num = max(num, len(tmp1 & tmp2))
print(num)

-for i in range(len(s)): -    t1 = s[:i] -    t2 = s[i:] -    rec = 0 -    rec1 = [] -    for j in range(len(s)): -        if s[j] in t1 and s[j] in t2 and s[j] not in rec1: -            rec += 1 -            rec1.append(s[j]) -    num = max(num, rec) +for i in range(1, n): +    q = s[:i] +    p = s[i:] +    tmp1 = set() +    for j in q: +        tmp1.add(j) +    tmp2 = set() +    for j in p: +        tmp2.add(j) +    num = max(num, len(tmp1 & tmp2))