N=int(eval(input()))

S=list(eval(input()))



a=[]

b=[]

max=0



for i in range(1,(N)):

  a=[]

  b=[]

  for j in range(i):

    #print(i,j,S[j])

    a.append(S[j])

  #print(a,len(set(a)))

  for j in range(i,N):

    #print(i,j,S[j])

    b.append(S[j])

  #print(b,len(set(b)))

  if len(set(a)&set(b))>max:

    max=len(set(a)&set(b))

print(max)
N=int(eval(input()))

S=list(eval(input()))



max=0



for i in range(1,(N)):

  a=S[:i]

  b=S[i:]

  L= len(set(a)&set(b))

  if L>max:

    max=L

print(max)
N = int(eval(input()))
S = list(eval(input()))
a = []
b = []
max = 0
for i in range(1, (N)):
    a = []
    b = []
    for j in range(i):
        # print(i,j,S[j])
        a.append(S[j])
    # print(a,len(set(a)))
    for j in range(i, N):
        # print(i,j,S[j])
        b.append(S[j])
    # print(b,len(set(b)))
    if len(set(a) & set(b)) > max:
        max = len(set(a) & set(b))
print(max)

N = int(eval(input()))
S = list(eval(input()))
max = 0
for i in range(1, (N)):
    a = S[:i]
    b = S[i:]
    L = len(set(a) & set(b))
    if L > max:
        max = L
print(max)

-a = [] -b = [] -    a = [] -    b = [] -    for j in range(i): -        # print(i,j,S[j]) -        a.append(S[j]) -    # print(a,len(set(a))) -    for j in range(i, N): -        # print(i,j,S[j]) -        b.append(S[j]) -    # print(b,len(set(b))) -    if len(set(a) & set(b)) > max: -        max = len(set(a) & set(b)) +    a = S[:i] +    b = S[i:] +    L = len(set(a) & set(b)) +    if L > max: +        max = L