let rec iter a b f = if a >= b then [] else let v = f a in v :: iter (a+1) b f
let stat s =
  let res = Array.make 26 false in
  String.iter (fun c -> res.(int_of_char c - 97) <- true) s;
  res
let () =
  Scanf.scanf "%d %s" @@ fun n s ->
  iter 1 n (fun l ->
    let x, y = stat (String.sub s 0 l), stat (String.sub s l (n-l)) in
    iter 0 26 (fun i -> if x.(i) && y.(i) then 1 else 0)
    |> List.fold_left (+) 0)
  |> List.fold_left max 0 |> Printf.printf "%d\n"