#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
void print() {}
template <class H, class... T>
void print(H&& h, T&&... t) {
  cout << h << " \n"[sizeof...(t) == 0];
  print(forward<T>(t)...);
}
ll sum[27][200010] = {};
ll dp[200010] = {};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  ll N = S.size();
  vector<ll> pos[27];
  for (ll i = (0); i < (N); i++) pos[S[i] - 'a'].push_back(i);
  for (ll i = (0); i < (N); i++) {
    for (ll c = (0); c < (26); c++) {
      if (c == S[i] - 'a') {
        sum[c][i + 1] += sum[c][i] + 1;
      } else {
        sum[c][i + 1] += sum[c][i];
      }
    }
  }
  dp[0] = 0;
  for (ll i = (0); i < (N); i++) dp[i + 1] = INF;
  for (ll i = (0); i < (N); i++) {
    for (ll j = (0); j < (i + 1); j++) {
      ll odd_cnt = 0;
      for (ll k = (0); k < (26); k++) {
        if ((sum[k][i + 1] - sum[k][j]) % 2 == 1) odd_cnt++;
      }
      if (odd_cnt <= 1) {
        dp[i + 1] = min(dp[i + 1], dp[j] + 1);
      }
    }
  }
  print(dp[N]);
}
