#include <bits/stdc++.h>
using namespace std;
void create_array(string S, int length, int *to_array) {
  for (int i = 0; i < length; i++) {
    char c = S[i];
    int num = c - 97;
    to_array[num]++;
  }
  return;
}
int odds(int *array) {
  int odd = 0;
  for (int i = 0; i < 26; i++) {
    if (array[i] % 2 == 1) {
      odd++;
      array[i] = 0;
    }
  }
  return odd;
}
void show_array(int *n) {
  for (int i = 0; i < 26; i++) {
    printf("n[%d] : %d\n", i, n[i]);
  }
  return;
}
int main(int argc, char *argv[]) {
  string S;
  cin >> S;
  int n[26] = {};
  string S2 = S;
  int sets = 0;
  while (S.length() > 0) {
    int numofodd = 0;
    int l = S.length();
    while (true) {
      create_array(S, l, n);
      numofodd = odds(n);
      if (numofodd > 1) {
        l--;
      } else {
        break;
      }
    }
    sets++;
    S = S.substr(l);
  }
  int sets2 = sets;
  sets = 0;
  S = S2;
  reverse(S.begin(), S.end());
  while (S.length() > 0) {
    int numofodd = 0;
    int l = S.length();
    while (true) {
      create_array(S, l, n);
      numofodd = odds(n);
      if (numofodd > 1) {
        l--;
      } else {
        break;
      }
    }
    sets++;
    S = S.substr(l);
  }
  if (sets > sets2) {
    sets = sets2;
  }
  cout << sets << endl;
  return 0;
}
