#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 hash_val[200010] = {};
ll get_val(ll lv, ll rv) { return hash_val[rv + 1] ^ hash_val[lv]; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  ll N = S.size();
  for (ll i = (0); i < (N); i++) {
    ll v = S[i] - 'a';
    hash_val[i + 1] = (hash_val[i] ^ (1LL << v));
  }
  ll dp[200010] = {};
  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 v = get_val(j, i);
      ll cnt = __builtin_popcount(v);
      if (cnt <= 1) {
        dp[i + 1] = min(dp[i + 1], dp[j] + 1);
      }
    }
  }
  print(dp[N]);
}
