n = int(eval(input()))

s = eval(input())

f = []

for i in range(n):

    a = []

    for j in range(i):

        if s[j] in s[i:]:

            a.append(s[j])

    f.append(len(set(a)))

print((max(f)))
n = int(eval(input()))

s = eval(input())

a = 0

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

    a = max(a,len(set(s[:i]) & set(s[i:])))



print(a)
n = int(eval(input()))
s = eval(input())
f = []
for i in range(n):
    a = []
    for j in range(i):
        if s[j] in s[i:]:
            a.append(s[j])
    f.append(len(set(a)))
print((max(f)))

n = int(eval(input()))
s = eval(input())
a = 0
for i in range(1, n + 1):
    a = max(a, len(set(s[:i]) & set(s[i:])))
print(a)

-f = [] -for i in range(n): -    a = [] -    for j in range(i): -        if s[j] in s[i:]: -            a.append(s[j]) -    f.append(len(set(a))) -print((max(f))) +a = 0 +for i in range(1, n + 1): +    a = max(a, len(set(s[:i]) & set(s[i:]))) +print(a)