#include <bits/stdc++.h>
using namespace std;
template <typename T>
void get(T& t) {
  cin >> t;
}
struct obj {
  int idx, dist;
  obj(int i, int j) : idx(i), dist(j) {}
  bool operator<(const obj& o) const { return dist < o.dist; }
};
priority_queue<obj> mqueue;
string str;
void proce(obj start) {
  int bb = 0;
  int ret = start.idx;
  for (int i = start.idx; i < str.size(); i++) {
    bb ^= 1 << (str.at(i) - 'a');
    if ((bb & (bb - 1)) == 0) {
      obj o(i + 1, start.dist - 1);
      mqueue.push(o);
    }
  }
  return;
}
int main(void) {
  get(str);
  mqueue.push(obj(0, 0));
  while (true) {
    obj o = mqueue.top();
    mqueue.pop();
    if (o.idx == str.size()) {
      cout << -o.dist << endl;
      return 0;
    }
    proce(o);
  }
}
