#include <bits/stdc++.h>
using uint = unsigned int;
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
template <ostream& out = cout, class... T>
void prints(T&&...) {}
template <ostream& out = cout, class... T>
void printe(T&&...) {}
template <ostream& out = cout, class... T>
void printw(T&&...) {}
template <ostream& out = cout, class... T>
void printew(T&&...) {}
template <ostream& out = cout, class... T>
void printb(T&&...) {}
template <ostream& out = cout, class... T>
void printd(T&&...) {}
template <ostream& out = cout, class... T>
void printde(T&&...){};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  auto ok = [&](vector<int>& cs) {
    int a1 = 0;
    for (int i = 0; i < 26; i++) {
      a1 += cs[i] % 2;
    }
    return a1 <= 1;
  };
  vector<int> cs(26);
  for (auto e : s) {
    cs[e - 'a']++;
  }
  int ans = 1;
  if (ok(cs)) {
    cout << ans << '\n';
    return 0;
  }
  int end = s.size();
  vector<int> accs(end + 1);
  int bits = 0;
  for (size_t i = 0; i < s.size(); i++) {
    bits ^= 1 << (s[i] - 'a');
    accs[i + 1] = bits;
  }
  auto ok2 = [&](int l, int r) {
    int b = accs[r] ^ accs[l - 1];
    int num = 0;
    for (int i = 0; i < 30; i++) {
      num += (bool)(b & (1 << i));
    }
    return num <= 1;
  };
  vector<int> memo(end + 1, M);
  int mini = M;
  function<void(int, int)> solve = [&](int idx, int acc) {
    printd(idx, acc);
    if (idx > end) {
      memo[idx] = mini = min(mini, acc);
      return;
    }
    if (ok2(idx, end)) {
      memo[idx] = mini = min(mini, acc + 1);
      return;
    }
    if (memo[idx] <= acc || mini <= acc) {
      return;
    }
    vector<int> cs3(26);
    int odds = 0;
    for (int i = end; i >= idx; i--) {
      if (ok2(idx, i)) {
        solve(i + 1, acc + 1);
      }
    }
  };
  solve(1, 0);
  prints(memo);
  cout << mini << '\n';
}
