#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)(1e5 + 2e1);
const double PI = acos(-1.0);
int n, ans, q;
char c[222];
vector<pair<int, string> > v;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
  }
  for (int i = 1; i <= n; i++) {
    int k = i;
    string t = "";
    while (islower(c[k])) {
      bool flag = 0;
      for (int j = 0; j <= (int)(t.length()) - 1; j++) {
        if (t[j] == c[k]) {
          flag = 1;
          break;
        }
      }
      if (!flag) t += c[k];
      k++;
    }
    v.push_back(make_pair((int)(t.length()), t));
  }
  sort(v.begin(), v.end());
  cout << v[(int)v.size() - 1].first;
  return 0;
}
