import collections



N = int(eval(input()))

s = eval(input())



maxx = 0



for i in range(N - 1):

    left = s[: i + 1]

    right = s[i + 1 :]

    

    CNT_left = collections.Counter(left)

    CNT_right = collections.Counter(right)

    

    cnt = 0

    

    for k in list(CNT_left.keys()):

        num = CNT_right[k]

        

        if (num >= 1):

            cnt += 1

    

    maxx = max(maxx, cnt)

    

print(maxx)

N = int(eval(input()))

s = eval(input())



maxx = 0



for i in range(N - 1):

    left = s[: i + 1]

    right = s[i + 1 :]

    

    and_LR = set(left) & set(right)

    cnt = len(and_LR)

    

    maxx = max(maxx, cnt)

    

print(maxx)

import collections

N = int(eval(input()))
s = eval(input())
maxx = 0
for i in range(N - 1):
    left = s[: i + 1]
    right = s[i + 1 :]
    CNT_left = collections.Counter(left)
    CNT_right = collections.Counter(right)
    cnt = 0
    for k in list(CNT_left.keys()):
        num = CNT_right[k]
        if num >= 1:
            cnt += 1
    maxx = max(maxx, cnt)
print(maxx)

N = int(eval(input()))
s = eval(input())
maxx = 0
for i in range(N - 1):
    left = s[: i + 1]
    right = s[i + 1 :]
    and_LR = set(left) & set(right)
    cnt = len(and_LR)
    maxx = max(maxx, cnt)
print(maxx)

-import collections - -    CNT_left = collections.Counter(left) -    CNT_right = collections.Counter(right) -    cnt = 0 -    for k in list(CNT_left.keys()): -        num = CNT_right[k] -        if num >= 1: -            cnt += 1 +    and_LR = set(left) & set(right) +    cnt = len(and_LR)