#include <bits/stdc++.h>
using namespace std;
struct S {
  string str;
  int summ;
};
bool check(string s) {
  long f[26];
  for (int i = (0); i < (int)(26); i++) {
    f[i] = 0;
  }
  for (long i = 0; i < s.size(); i++) {
    int num = s[i] - 'a';
    f[num]++;
  }
  bool ff = false;
  for (long i = 0; i < 26; i++) {
    if (f[i] % 2 == 1) {
      if (ff) {
        return false;
      } else {
        ff = true;
      }
    }
  }
  return true;
}
int main() {
  string s;
  cin >> s;
  queue<struct S> st;
  struct S sss = {s, 1};
  st.push(sss);
  long sum = 1000;
  while (!st.empty()) {
    struct S ttt = st.front();
    st.pop();
    string ss = ttt.str;
    for (long i = 0; i < ss.size(); i++) {
      string t = "";
      for (long j = 0; j < ss.size() - i; j++) {
        t += ss[j];
      }
      if (check(t)) {
        string t2 = "";
        for (long j = ss.size() - i; j < ss.size(); j++) {
          t2 += ss[j];
        }
        if (t2 != "") {
          struct S tmp2 = {t2, ttt.summ + 1};
          st.push(tmp2);
        } else {
          if (sum > ttt.summ) {
            sum = ttt.summ;
          }
          break;
        }
      }
    }
  }
  cout << (sum) << endl;
  return 0;
}
