local n = io.read("*n", "*l")
local s = io.read()

local function check(i, str)
  local left = str:sub(1, i)
  local right = str:sub(i + 1, #str)
  local t = {}
  for i = 1, i do
    t[left:sub(i, i)] = true
  end
  local c = 0
  for k, v in pairs(t) do
    if right:find(k) then
      c = c + 1
    end
  end
  return c
end

local cnt = 0
for i = 1, n - 1 do
  cnt = math.max(cnt, check(i, s))
end
print(cnt)
