#include <bits/stdc++.h>
using namespace std;
int dx[8] = {0, 0, -1, 1, 1, 1, -1, -1};
int dy[8] = {-1, 1, 0, 0, 1, -1, 1, -1};
const int SIZE = 200050;
int split(string S, int a) {
  int alpha[26] = {}, beta[26] = {};
  int sz = S.length();
  if (sz == 0) return a;
  if (sz == 1) return a + 1;
  vector<char> v, w;
  for (int i = 0; i < sz; i++) {
    alpha[S[i] - 'a']++;
    beta[S[i] - 'a']++;
    v.push_back(S[i]);
  }
  w = v;
  reverse(v.begin(), v.end());
  int aaa = 0;
  for (int i = 0; i < 26; i++) {
    if (alpha[i] % 2) aaa++;
  }
  if (aaa <= 1) return a + 1;
  int x, y;
  for (int i = 0; i < sz; i++) {
    alpha[v[i] - 'a']--;
    int odd = 0;
    for (int j = 0; j < 26; j++) {
      if (alpha[i] % 2) odd++;
    }
    if (odd <= 1) {
      x = i;
      break;
    }
  }
  for (int i = 0; i < sz; i++) {
    beta[w[i] - 'a']--;
    int odd = 0;
    for (int j = 0; j < 26; j++) {
      if (alpha[i] % 2) odd++;
    }
    if (odd <= 1) {
      y = i;
      break;
    }
  }
  string X = S.substr(sz - x - 1), Y = S.substr(0, y + 1);
  if (X.length() >= Y.length())
    return split(Y, a + 1);
  else
    return split(X, a + 1);
}
int main() {
  string S;
  cin >> S;
  cout << split(S, 0) << endl;
  ;
  return 0;
}
