function Main(input) {
    input = input.split("\n");
    ans = 0;
    alp = "abcdefghijklmnopqrstuvwxyz";
    for (i = 1; i < input[1].length; i++) {
        cnt = 0;
        sub1 = input[1].substring(0, i);
        sub2 = input[1].substring(i);
        for (j = 0; j < alp.length; j++)
            if (sub1.indexOf(alp[j]) != -1 && sub2.indexOf(alp[j]) != -1) cnt++;
        ans = Math.max(ans, cnt);
    }
    console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));