#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
using namespace std;
int main() {
	int n, coun, ans = 0;
	string h;
	cin >> n >> h;
	for (int i = 1; i < n; ++i) {
		string mon = h.substr(0, i), mmon = h.substr(i);
		coun = 0;
		for (char j = 'a'; j <= 'z'; ++j) {
			if (mon.find(j) != -1 && mmon.find(j) != -1) { ++coun; }
		}
		ans = max(ans, coun);
	}
	cout << ans << endl;
}