function qchong(s)
  local t={}
  for i=1,#s do
    t[i]=string.sub(s,i,i)
  end
  table.sort(t)
  local i=1
  while t[i] do
    if t[i]==t[i+1] then
      table.remove(t,i)
      i=i-1
    end
    i=i+1
  end
  return t
end
N=io.read()
S=io.read()
res={}
for i=1,#S-1 do
  a=string.sub(S,1,i)
  b=string.sub(S,i+1,#S)
  a=qchong(a)
  b=qchong(b)
  local count=0
  for i=1,#a do
    for j=1,#b do
      if a[i]==b[j] then
        count=count+1
      end
    end
  end
  res[i]=count
end
table.sort(res,function (a,b) return a>b end)
print(res[1])
