n = int(eval(input()))

s = list(eval(input()))

max_num = 0





def check_list_element(list):

    a = []

    for i in list:

        if i not in a:

            a.append(i)

    return a





for i in range(n):

    count = 0

    a = s[:i]

    b = s[i:]

    a = check_list_element(a)

    for j in range(len(a)):

        if a[j] in b:

            count += 1

    if count >= max_num:

        max_num = count





print(max_num)



n = int(eval(input()))

s = list(eval(input()))



max_char = 0



for i in range(1, n):

    s1 = set(s[0:i])

    s2 = set(s[i:])

    num = len(s1 & s2)

    if num > max_char:

        max_char = num

print(max_char)
n = int(eval(input()))
s = list(eval(input()))
max_num = 0


def check_list_element(list):
    a = []
    for i in list:
        if i not in a:
            a.append(i)
    return a


for i in range(n):
    count = 0
    a = s[:i]
    b = s[i:]
    a = check_list_element(a)
    for j in range(len(a)):
        if a[j] in b:
            count += 1
    if count >= max_num:
        max_num = count
print(max_num)

n = int(eval(input()))
s = list(eval(input()))
max_char = 0
for i in range(1, n):
    s1 = set(s[0:i])
    s2 = set(s[i:])
    num = len(s1 & s2)
    if num > max_char:
        max_char = num
print(max_char)

-max_num = 0 - - -def check_list_element(list): -    a = [] -    for i in list: -        if i not in a: -            a.append(i) -    return a - - -for i in range(n): -    count = 0 -    a = s[:i] -    b = s[i:] -    a = check_list_element(a) -    for j in range(len(a)): -        if a[j] in b: -            count += 1 -    if count >= max_num: -        max_num = count -print(max_num) +max_char = 0 +for i in range(1, n): +    s1 = set(s[0:i]) +    s2 = set(s[i:]) +    num = len(s1 & s2) +    if num > max_char: +        max_char = num +print(max_char)