n,a=open(0).read().split();a,l=list(a),[]

for s in range(1,len(a)):l.append(len(set(a[:s])&set(a[s:])))

print((max(l)))
n,a=eval(input()),eval(input());print((max(len(set(a[:s])&set(a[s:]))for s in range(len(a)))))
n, a = open(0).read().split()
a, l = list(a), []
for s in range(1, len(a)):
    l.append(len(set(a[:s]) & set(a[s:])))
print((max(l)))

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

-n, a = open(0).read().split() -a, l = list(a), [] -for s in range(1, len(a)): -    l.append(len(set(a[:s]) & set(a[s:]))) -print((max(l))) +n, a = eval(input()), eval(input()) +print((max(len(set(a[:s]) & set(a[s:])) for s in range(len(a)))))