#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
  string S;
  cin >> S;
  vector<array<int, 26>> count(S.size() + 1);
  for (int a = 0; a < (26); ++a) count[0][a] = 0;
  for (int i = 0; i < (S.size()); ++i) {
    for (int a = 0; a < (26); ++a) count[i + 1][a] = count[i][a];
    ++(count[i + 1][S[i] - 'a']);
  }
  auto check = [&](int l, int r) {
    if (l == r) return true;
    int odd = 0;
    for (int a = 0; a < (26); ++a) {
      if ((count[r + 1][a] - count[l][a]) % 2 == 1) ++odd;
    }
    return odd < 2;
  };
  function<int(int, int)> func = [&](int l, int r) {
    if (check(l, r)) return 1;
    int ret = r - l + 1;
    for (int i = l; i < r; ++i) {
      if (check(l, i)) {
        ret = min(ret, 1 + func(i + 1, r));
      }
    }
    return ret;
  };
  cout << func(0, S.size() - 1) << endl;
}
