#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-9;
const long long INF = 10e17;
double equal(double a, double b) { return fabs(a - b) < DBL_EPSILON; }
std::istream &operator>>(std::istream &in, set<int> &o) {
  int a;
  in >> a;
  o.insert(a);
  return in;
}
std::istream &operator>>(std::istream &in, queue<int> &o) {
  long long a;
  in >> a;
  o.push(a);
  return in;
}
bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }
bool is_kaibun(vector<int> &hs, int i, int j) {
  int k = hs[j] ^ (i == 0 ? 0 : hs[i - 1]);
  int f = __builtin_popcount(k);
  return f <= 1;
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> hs(n, 0);
  for (int i = 0; i < (n); ++i) {
    if (i == 0) {
      char c = s[i];
      int j = c - 'a';
      int next = 1 << j;
      hs[0] = next;
    } else {
      char c = s[i];
      int j = c - 'a';
      int next = hs[i - 1] ^ (1 << j);
      hs[i] = next;
    }
  }
  vector<int> dp(n, -1);
  auto set = [&](int i, int k) {
    if (dp[i] == -1)
      dp[i] = k;
    else
      dp[i] = min(dp[i], k);
  };
  for (int j = 0; j < n; j++) {
    for (int i = 0; i <= j; i++) {
      if (is_kaibun(hs, i, j)) {
        set(j, (i == 0 ? 0 : dp[i - 1]) + 1);
      }
    }
  }
  cout << dp[n - 1] << endl;
}
