def f(s, t):

    res = 0

    for i in set(s):

        for j in set(t):

            if i == j:

                res += 1

    return res



N = int(eval(input()))

S = eval(input())

ans = 0

for i in range(N):

    ans = max(ans, f(S[:i], S[i:]))

print(ans)
def f(s, t):

    return len(set(s) & set(t))



N = int(eval(input()))

S = eval(input())

ans = 0

for i in range(N):

    ans = max(ans, f(S[:i], S[i:]))

print(ans)
def f(s, t):
    res = 0
    for i in set(s):
        for j in set(t):
            if i == j:
                res += 1
    return res


N = int(eval(input()))
S = eval(input())
ans = 0
for i in range(N):
    ans = max(ans, f(S[:i], S[i:]))
print(ans)

def f(s, t):
    return len(set(s) & set(t))


N = int(eval(input()))
S = eval(input())
ans = 0
for i in range(N):
    ans = max(ans, f(S[:i], S[i:]))
print(ans)

-    res = 0 -    for i in set(s): -        for j in set(t): -            if i == j: -                res += 1 -    return res +    return len(set(s) & set(t))