#include <bits/stdc++.h>
using namespace std;
map<int, int> Map;
string S;
int a[26], c[200009], dp[200009];
int getval() {
  int sum = 0;
  for (int i = 0; i < 26; i++) sum += (1 << i) * (a[i] % 2);
  return sum;
}
int main() {
  cin >> S;
  Map[getval()] = 0;
  for (int i = 0; i < S.size(); i++) {
    a[S[i] - 'a']++;
    Map[getval()] = i + 1;
    c[i + 1] = getval();
  }
  for (int i = 0; i <= S.size(); i++) dp[i] = (1 << 30);
  dp[0] = 0;
  for (int i = 0; i < S.size(); i++) {
    if (Map[c[i]] >= 0) dp[Map[c[i]]] = min(dp[Map[c[i]]], dp[i] + 1);
    int bit[26];
    for (int j = 0; j < 26; j++) bit[j] = (c[i] / (1 << j)) % 2;
    for (int j = 0; j < 26; j++) {
      int T = c[i];
      if (bit[j] == 0)
        T += (1 << i);
      else
        T -= (1 << i);
      if (Map[T] >= 0) dp[Map[T]] = min(dp[Map[T]], dp[i] + 1);
    }
  }
  cout << dp[S.size()] << endl;
  return 0;
}
