function main(input) {
	var a = input.split('\n');
	var N = parseInt(a[0], 10);
	var S = a[1];
	var countmax = 0;
	for(i=1;i<N;i++){
		var S1 = S.slice(0,i);
		var S2 = S.slice(i,N);
		//console.log(S1);
		//console.log(S2);
		var count = 0;
		for(j=0;j<S1.length;j++){
			var t = 0;
			for(k=j+1;k<S1.length;k++){
				if(S1[j] === S1[k]){
					t = -1;
					break;
				}
			}
			if(t >= 0){
				for(k=0;k<S2.length;k++){
					if(S1[j] === S2[k]){
						t = 1;
						break;
					}
				}
				if(t === 1){
					count += 1;
				}
			}
			//console.log(count);
		}
		countmax = Math.max(countmax,count);
	}
	console.log(countmax);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));