n = int(eval(input()))

s = eval(input())

M = 0

for i in range(1, n):

    cnt = 0

    s1 = s[:i]

    s2 = s[i:]

    t = {}

    for x in s1:

        if x not in t: t[x]=1

    for k in s2:

        if k not in t: t[k]=0

        if t[k] == 1: t[k]+=1

    for x, y in list(t.items()):

        if y==2: cnt+=1

    M = max(cnt, M)

print(M)
n = int(eval(input()))

s = eval(input())

ans = 0

for i in range(1,len(s)):

    s1 = set(s[:i])

    s2 = set(s[i:])

    ans = max(ans, len(s1&s2))

print(ans)
n = int(eval(input()))
s = eval(input())
M = 0
for i in range(1, n):
    cnt = 0
    s1 = s[:i]
    s2 = s[i:]
    t = {}
    for x in s1:
        if x not in t:
            t[x] = 1
    for k in s2:
        if k not in t:
            t[k] = 0
        if t[k] == 1:
            t[k] += 1
    for x, y in list(t.items()):
        if y == 2:
            cnt += 1
    M = max(cnt, M)
print(M)

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

-M = 0 -for i in range(1, n): -    cnt = 0 -    s1 = s[:i] -    s2 = s[i:] -    t = {} -    for x in s1: -        if x not in t: -            t[x] = 1 -    for k in s2: -        if k not in t: -            t[k] = 0 -        if t[k] == 1: -            t[k] += 1 -    for x, y in list(t.items()): -        if y == 2: -            cnt += 1 -    M = max(cnt, M) -print(M) +ans = 0 +for i in range(1, len(s)): +    s1 = set(s[:i]) +    s2 = set(s[i:]) +    ans = max(ans, len(s1 & s2)) +print(ans)