#include <bits/stdc++.h>
using LL = long long int;
using namespace std;
string S;
class TTT {
 public:
  TTT(int a, bitset<26> b) {
    first = a;
    second = b;
  }
  int first;
  bitset<26> second;
  bool operator<(const TTT& p) const { return first < p.first; }
  bool operator>(const TTT& p) const { return first > p.first; }
};
int main() {
  cin >> S;
  priority_queue<TTT, vector<TTT>, greater<TTT>> pque;
  pque.push(TTT(0, bitset<26>()));
  for (int i = 0; i < (int)S.length(); i++) {
    set<unsigned long> SS;
    queue<TTT> que;
    while (pque.size() > 0) {
      auto Bit = pque.top();
      pque.pop();
      if (!SS.insert(Bit.second.to_ulong()).second) {
        continue;
      }
      Bit.second.flip(S[i] - 'a');
      if (Bit.second.count() == 1) {
        que.push(TTT(Bit.first + 1, bitset<26>()));
        que.push(TTT(Bit.first, Bit.second));
      } else {
        que.push(TTT(Bit.first, Bit.second));
      }
    }
    while (que.size() > 0) {
      pque.push(que.front());
      que.pop();
    }
  }
  int ans = 1145141919;
  while (pque.size()) {
    auto b = pque.top();
    pque.pop();
    if (b.second.count() == 1) {
      ans = min(ans, b.first + 1);
    } else if (b.second.count() == 0) {
      ans = min(ans, b.first + 1);
    }
  }
  cout << ans << endl;
  return 0;
}
