"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0]);
    const S = arg[1].split("");
    
    let answer = 0;
    
    for(let i=0; i<N-1; i++) {
        const front = S.slice(0, ~~i + 1); 
        const back  = S.slice(~~i + 1, N);
        
        let map = {}
        
        for(let j in front) {
            if(!map[front[j]]) {
                map[front[j]] = 1
            }
        }
        
        for(let j in back) {
            if(map[back[j]]) {
                map[back[j]]++;
            }
        }
        
        let temp = 0;

        for(let key in map) {
            if(map[key] > 1) {
                temp++;
            }
        }
        
        answer = Math.max(answer, temp);
    }
    
    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));