import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  auto n = readln.chomp.to!int;
  auto s = readln.chomp;
  int m;
  foreach (i; 1..n-1) {
    auto a = s[0..i];
    auto b = s[i..$];
    int[int] cnt1;
    int[int] cnt2;
    foreach (e; a) {
      cnt1[e]++;
    }
    foreach (e; b) {
      cnt2[e]++;
    }
    int lm;
    foreach (k; cnt1.keys) {
      if (cnt2.get(k, 0)) {
        lm++;
      }
    }

    m = max(m, lm);
  }

  m.writeln;
}
