n = int(eval(input()))

k = list(x for x in eval(input()))

ans = [0] * n

for i in range(n):

  l = []

  for j in range(0,i):

    if l.count(k[j]) == 0:

      l.append(k[j])

      if k[i:n].count(k[j]) > 0:

        ans[i] += 1

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

k = list(x for x in eval(input()))

print((max(len(set(k[:i])&set(k[i:])) for i in range(0, n))))
n = int(eval(input()))
k = list(x for x in eval(input()))
ans = [0] * n
for i in range(n):
    l = []
    for j in range(0, i):
        if l.count(k[j]) == 0:
            l.append(k[j])
            if k[i:n].count(k[j]) > 0:
                ans[i] += 1
print((max(ans)))

n = int(eval(input()))
k = list(x for x in eval(input()))
print((max(len(set(k[:i]) & set(k[i:])) for i in range(0, n))))

-ans = [0] * n -for i in range(n): -    l = [] -    for j in range(0, i): -        if l.count(k[j]) == 0: -            l.append(k[j]) -            if k[i:n].count(k[j]) > 0: -                ans[i] += 1 -print((max(ans))) +print((max(len(set(k[:i]) & set(k[i:])) for i in range(0, n))))