#include <bits/stdc++.h>
using namespace std;
const int INF =
    sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int dfs(string &s, int i = 0, int n = 0) {
  if (!(i < s.length())) return n;
  vector<int> v(26, 0), x;
  for (int j = (i); j < (s.length()); j++) {
    v[s[j] - 'a']++;
    int odd(0), len = j - i + 1;
    for (int k = (0); k < (v.size()); k++) {
      if (v[k] & 1) odd++;
    }
    if (len & 1 && odd == 1 || odd == 0 && len % 2 == 0) x.push_back(j);
  }
  int ret(INF);
  for (int j = (0); j < (x.size()); j++) {
    chmin(ret, dfs(s, x[j] + 1, n + 1));
  }
  return ret;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  cout << dfs(s) << endl;
  return 0;
}
