#include <bits/stdc++.h>
#pragma gcc optimize("Ofast")
using namespace std;
template <typename T>
using maxHeap = priority_queue<T, vector<T>, less<T>>;
template <typename T>
using minHeap = priority_queue<T, vector<T>, greater<T>>;
inline void input(int& _x) {
  _x = 0;
  int _tmp = 1;
  char _tc = getchar();
  while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
  if (_tc == '-') _tc = getchar(), _tmp = -1;
  while (_tc >= '0' && _tc <= '9') _x = _x * 10 + (_tc - 48), _tc = getchar();
  _x *= _tmp;
}
inline void output(int _x) {
  char _buff[20];
  int _f = 0;
  if (_x == 0) putchar('0');
  while (_x > 0) {
    _buff[_f++] = _x % 10 + '0';
    _x /= 10;
  }
  for (_f -= 1; _f >= 0; _f--) putchar(_buff[_f]);
  putchar('\n');
}
template <typename Iter>
ostream& _out(ostream& s, Iter b, Iter e) {
  s << "[";
  for (auto it = b; it != e; it++) s << (it == b ? "" : " ") << *it;
  s << "]";
  return s;
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> p) {
  return out << '(' << p.first << ", " << p.second << ')';
}
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& c) {
  return _out(s, c.begin(), c.end());
}
map<int, int> m;
vector<int> sp, enq;
vector<set<int>> G;
queue<pair<int, int>> Q;
signed main() {
  string s;
  cin >> s;
  int n = s.size();
  sp.resize(n + 1);
  m[0] = 0;
  for (int i = 1; i <= n; i++) {
    sp[i] = sp[i - 1] ^ (1 << (s[i - 1] - 'a')), m[sp[i]] = i;
  }
  G.resize(n + 1);
  for (int i = 0; i <= n; i++) {
    int id = m[sp[i]];
    for (int j = 0; j < 26; j++) {
      if (m.find(sp[i] ^ (1 << j)) != m.end()) {
        G[id].insert(m[sp[i] ^ (1 << j)]);
      }
    }
  }
  enq.resize(n + 1);
  if (m[sp[0]] == n) return cout << 1 << '\n', 0;
  Q.push({m[0], 1});
  enq[m[0]] = 1;
  while (!Q.empty()) {
    pair<int, int> i = Q.front();
    Q.pop();
    if (i.first == n) return cout << i.second - 1 << '\n', 0;
    for (auto x : G[i.first]) {
      if (!enq[x]) {
        Q.push({x, i.second + 1});
        enq[x] = 1;
      }
    }
  }
  assert(false);
}
