#include <bits/stdc++.h>
using namespace std;
string S;
long long dp[200005];
map<char, long long> hist[200005];
bool check(long long left, long long right) {
  long long num = right - left + 1;
  long long odd = 0;
  long long even = 0;
  for (char ch = 'a'; ch <= 'z'; ch++) {
    long long alnum;
    if (left == 0) {
      alnum = hist[right][ch];
    } else {
      alnum = hist[right][ch] - hist[left - 1][ch];
    }
    if (alnum % 2 == 0) {
      even++;
    } else {
      odd++;
    }
  }
  if (num % 2 == 0) {
    if (odd) {
      return false;
    }
    return true;
  } else {
    if (odd == 1) {
      return true;
    }
    return false;
  }
}
int main() {
  cin >> S;
  for (long long i = 0; i < S.size(); i++) {
    dp[i] = INT_MAX;
    if (i == 0) {
      hist[i][S[i]]++;
    } else {
      hist[i] = hist[i - 1];
      hist[i][S[i]]++;
    }
  }
  dp[0] = 0;
  for (long long cur = 1; cur < S.size(); cur++) {
    for (long long i = 0; i < cur; i++) {
      if (check(i, cur)) {
        dp[cur] = min(dp[cur], dp[i] + 1);
      }
    }
    if (dp[cur] = INT_MAX) {
      dp[cur] = dp[cur - 1] + 1;
    }
  }
  long long ans = 0;
  long long cur = 0;
  while (cur < S.size()) {
    for (long long end = S.size() - 1; end >= cur; end--) {
      if (check(cur, end)) {
        cur = end + 1;
        ans++;
        break;
      }
    }
  }
  long long ans2 = 0;
  long long cur2 = S.size() - 1;
  while (cur2 >= 0) {
    for (long long end = 0; end <= cur2; end++) {
      if (check(end, cur2)) {
        cur2 = end - 1;
        ans2++;
        break;
      }
    }
  }
  cout << min(ans, ans2) << endl;
}
