#include <bits/stdc++.h>
using namespace std;
int solve1(string s) {
  int i, j, n = s.size();
  vector<int> cnt(128);
  for (i = 0; i <= (int)(n)-1; i++) cnt[s[i]]++;
  int odd = 0;
  for (i = 'a'; i <= 'z'; i++) odd += cnt[i] % 2;
  if (odd <= 1) return 1;
  for (i = 0; i <= (int)(n)-1; i++) {
    cnt[s[i]]--;
    odd = 0;
    for (j = 'a'; j <= 'z'; j++) odd += cnt[j] % 2;
    if (odd <= 1) return 1 + solve1(s.substr(0, i + 1));
  }
  assert(false);
}
int solve2(string s) {
  int i, j, n = s.size();
  vector<int> cnt(128);
  for (i = 0; i <= (int)(n)-1; i++) cnt[s[i]]++;
  int odd = 0;
  for (i = 'a'; i <= 'z'; i++) odd += cnt[i] % 2;
  if (odd <= 1) return 1;
  for (i = (int)(n)-1; i >= 0; i--) {
    cnt[s[i]]--;
    odd = 0;
    for (j = 'a'; j <= 'z'; j++) odd += cnt[j] % 2;
    if (odd <= 1) return 1 + solve2(s.substr(i));
  }
  assert(false);
}
int main(void) {
  string s;
  cin >> s;
  cout << min(solve1(s), solve2(s)) << endl;
  return 0;
}
