'use strict'

function main(input) {
    input = input.split("\n");
    const N = parseInt(input[0]);
    const S = input[1];
    let ans = 0;
    for (let i = 0; i < N; i++) {
        let count = 0;
        let obj = {};
        for (let j = 0; j < i; j++) {
            obj[S[j]] = true;
        }
        for (let j = i; j < N; j++) {
            if (obj[S[j]]) {
                count++;
                delete obj[S[j]];
            }
        }
        if (count > ans)
            ans = count;
    }
    console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'));
