#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template <typename T>
using VT = vector<T>;
template <typename T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;
const int MAX = 2e5 + 10;
int imosArray[26][MAX];
int *imos[26];
bool isKaibun(const string &s, int l, int r) {
  int odd = 0;
  for (int(i) = 0; (i) < (26); (i)++)
    odd += (imos[i][r - 1] - imos[i][l - 1]) % 2;
  return odd < 2;
}
void TLE(const string &s) {
  static VI dp;
  const int L = s.size();
  dp = VI(L + 1, L);
  dp[0] = 0;
  for (int(i) = 0; (i) < (L); (i)++) {
    dp[i + 1] = min(dp[i + 1], dp[i] + 1);
    for (int(j) = (i + 1); (j) < (L + 1); (j)++) {
      if (isKaibun(s, i, j)) {
        if (dp[j] < dp[i] + 1) break;
        dp[j] = min(dp[j], dp[i] + 1);
      }
    }
  }
  cout << dp[L] << endl;
}
int main(void) {
  string s;
  cin >> s;
  for (int(i) = 0; (i) < (26); (i)++) {
    imos[i] = &imosArray[i][1];
  }
  for (int(i) = 0; (i) < (s.size()); (i)++) {
    imos[s[i] - 'a'][i]++;
  }
  for (int(i) = 0; (i) < (26); (i)++)
    for (int(j) = 0; (j) < (MAX - 2); (j)++) {
      imos[i][j + 1] += imos[i][j];
    }
  TLE(s);
}
