#include <bits/stdc++.h>
using namespace std;
int minAnswer = 1000000;
void init(int *a) {
  for (int i = 0; i < 26; i++) {
    a[i] = 0;
  }
}
int check(int *a) {
  int oneCount = 0;
  bool AllZero = true;
  for (int i = 0; i < 26; i++) {
    if (a[i] != 0) {
      AllZero = false;
    }
    if (a[i] % 2 == 1) {
      oneCount++;
    }
  }
  if (AllZero) {
    return 2;
  }
  if (oneCount <= 1) {
    return 1;
  }
  return 0;
}
void rec(const string &s, int *map, int index, int counter) {
  if (index == s.size()) {
    int c = counter;
    int ch = check(map);
    if (ch != 0) {
      if (ch == 1) {
        c++;
      }
      if (c > 0) {
        minAnswer = (c < minAnswer) ? c : minAnswer;
      }
    }
    return;
  } else {
    map[(int)s[index] - (int)'a']++;
    if (check(map)) {
      int *map2 = new int[26];
      init(map2);
      rec(s, map2, index + 1, counter + 1);
      delete[] map2;
    }
    rec(s, map, index + 1, counter);
  }
}
int main() {
  string s;
  cin >> s;
  int *map = new int[26];
  init(map);
  rec(s, map, 0, 0);
  cout << minAnswer;
  return 0;
}
