#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> memo(end + 1, 0);
  function<int(int)> solve = [&](int idx) {
    if (idx >= end) {
      return 0;
    }
    if (memo[idx]) {
      return memo[idx];
    }
    int idx0 = idx;
    int ret = 1e6;
    vector<int> cs3(26);
    int odds = 0;
    for (; idx < end; idx++) {
      if (odds == 0) {
        ret = min(ret, solve(idx + 1) + 1);
      }
      cs3[s[idx] - 'a']++;
      if (cs3[s[idx] - 'a'] % 2) {
        odds++;
      } else {
        odds--;
      }
    }
    if (odds <= 1) {
      return 1;
    }
    return memo[idx0] = ret;
  };
  cout << solve(0) << '\n';
}
