#include <bits/stdc++.h>
using namespace std;
string S;
long long cnt[26][200001];
bool ok(long long i, long long j) {
  long long s = 0;
  for (long long k = ((long long)0); k < ((long long)26); k++) {
    if ((cnt[k][j] - cnt[k][i]) % 2 == 1) s++;
  }
  return s <= 1;
}
int main(void) {
  cin >> S;
  for (long long i = ((long long)0); i < ((long long)26); i++)
    for (long long j = ((long long)0); j < ((long long)S.length() + 1); j++)
      cnt[i][j] = 0;
  for (long long i = ((long long)0); i < ((long long)S.length()); i++)
    cnt[S[i] - 'a'][i + 1] = 1;
  for (long long i = ((long long)0); i < ((long long)26); i++)
    for (long long j = ((long long)1); j < ((long long)S.length() + 1); j++)
      cnt[i][j] += cnt[i][j - 1];
  vector<long long> dp(S.length() + 1, (1LL << 60));
  dp[0] = 0;
  for (long long i = ((long long)0); i < ((long long)S.length()); i++) {
    for (long long k = 1; i + k < S.length() + 1; k++) {
      if (ok(i, i + k)) dp[i + k] = min(dp[i + k], dp[i] + 1);
    }
  }
  cout << dp[S.length()] << endl;
}
