#include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;
template <class S, class T>
istream& operator>>(istream& is, pair<S, T>& p) {
  return is >> p.first >> p.second;
}
template <class S, class T>
ostream& operator<<(ostream& os, const pair<S, T>& p) {
  return os << p.first << " " << p.second;
}
template <class T>
void maxi(T& x, T y) {
  if (x < y) x = y;
}
template <class T>
void mini(T& x, T y) {
  if (x > y) x = y;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
const LL MOD = 1e9 + 7;
int dp[200010];
int cnt[200010][26];
bool ispalin(int b, int e) {
  int odd = 0;
  for (int i = 0; i < 26; ++i) {
    if ((cnt[e][i] - cnt[b][i]) % 2) ++odd;
  }
  return odd <= 1;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  string S;
  cin >> S;
  int N = int((S).size());
  for (int i = (0); i < (N); ++i) {
    for (int j = (0); j < (26); ++j) cnt[i + 1][j] = cnt[i][j];
    cnt[i + 1][S[i] - 'a']++;
  }
  for (int i = 0; i < N; ++i) {
    dp[i + 1] = dp[i] + 1;
    for (int j = 0; j < i; ++j)
      if (ispalin(j, i + 1)) mini(dp[i + 1], dp[j] + 1);
  }
  cout << dp[N] << endl;
  return 0;
}
