def abc098_b():

    import numpy as np

    n = int(eval(input()))

    s = eval(input())

    counts = []

    if len(s) == 2:

        return [0,1][s[0] == s[1]]

    for i in range(1, n - 1):

        x = s[:i]

        y = s[i:]

        count = 0

        for let in set(x):

            if let in set(y):

                count += 1

        counts.append(count)

    return np.max(counts)





print((abc098_b()))
def abc098_b():

    n = int(eval(input()))

    s = eval(input())

    count_max = 0

    if len(s) == 2:

        return [0, 1][s[0] == s[1]]

    for i in range(1, n - 1):

        x = s[:i]

        y = s[i:]

        count = 0

        for let in set(x):

            if let in set(y):

                count += 1

        count_max = max(count,count_max)

    return count_max



print((abc098_b()))
def abc098_b():
    import numpy as np

    n = int(eval(input()))
    s = eval(input())
    counts = []
    if len(s) == 2:
        return [0, 1][s[0] == s[1]]
    for i in range(1, n - 1):
        x = s[:i]
        y = s[i:]
        count = 0
        for let in set(x):
            if let in set(y):
                count += 1
        counts.append(count)
    return np.max(counts)


print((abc098_b()))

def abc098_b():
    n = int(eval(input()))
    s = eval(input())
    count_max = 0
    if len(s) == 2:
        return [0, 1][s[0] == s[1]]
    for i in range(1, n - 1):
        x = s[:i]
        y = s[i:]
        count = 0
        for let in set(x):
            if let in set(y):
                count += 1
        count_max = max(count, count_max)
    return count_max


print((abc098_b()))

-    import numpy as np - -    counts = [] +    count_max = 0 -        counts.append(count) -    return np.max(counts) +        count_max = max(count, count_max) +    return count_max