import std.stdio;
import std.range;
import std.array;
import std.algorithm;
import std.string;
import std.conv;

void main(){
    auto n = readln().chomp().to!int();
    auto s = readln();
    solve(n, s).writeln();
}

int solve(int n, string s){
    int[] kindNums;
    foreach(cutPlace; 1..n) {
        auto right = s[0..cutPlace];
        auto left = s[cutPlace..$];
        char[] collection;
        foreach(ch; right) {
            if(left.find(ch).length != 0){
                if(collection.find(ch).length == 0){
                    collection ~= ch;
                }
            }
        }
        kindNums ~= collection.length.to!int();
    }
    return kindNums.sort!("a>b")()[0];
}