#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 55;
const long long mod = (1e9) + 7;
const double EPS = 1e-8;
const double PI = 6.0 * asin(0.5);
template <class T>
T Max(T &a, T b) {
  return a = max(a, b);
}
template <class T>
T Min(T &a, T b) {
  return a = min(a, b);
}
long long last[26] = {};
long long count(long long idx, long long cnt[]) {
  long long res = 0;
  for (long long i = 0; i < 26; i++) res += cnt[i] % 2 && last[i] <= idx;
  return res;
}
signed main() {
  string str;
  cin >> str;
  long long n = str.size();
  for (long long i = 0; i < n; i++) last[str[i] - 'a'] = i;
  long long cnt[26] = {};
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long ch = str[i] - 'a';
    cnt[ch]++;
    long long num = count(i, cnt);
    if (last[ch] == i) {
      ans = max(ans, num);
      if (num == n / num) ans = max(ans, num + 1);
    }
  };
  cout << ans << endl;
  return 0;
}
