n = int(eval(input()))

s = list(eval(input()))

ans = 0

for i in range(1,n):

  c = 0

  for j in set(s[:i]):

    if j in set(s[i:]):

      c += 1

  ans = max(ans,c)

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

s = list(eval(input()))

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

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

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