#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
class XorShift {
 public:
  unsigned long long x, y, z, w;
  double nL[65536];
  XorShift() { init(); }
  void init() {
    x = 314159265;
    y = 358979323;
    z = 846264338;
    w = 327950288;
    double n = 1 / (double)(2 * 65536);
    for (long long i = 0; i < 65536; i++) {
      nL[i] = log(((double)i / 65536) + n);
    }
  }
  inline unsigned long long next() {
    unsigned long long t = x ^ x << 11;
    x = y;
    y = z;
    z = w;
    return w = w ^ w >> 19 ^ t ^ t >> 8;
  }
  inline double nextLog() { return nL[next() & 0xFFFF]; }
  inline long long nextInt(long long m) { return (long long)(next() % m); }
  long long nextInt(long long min, long long max) {
    return min + nextInt(max - min + 1);
  }
  double nextDouble() { return (double)next() / ((long long)1 << 32); }
};
long long solve(string S) {
  long long N = (long long)S.size();
  vector<long long> R(N, N + 1);
  vector<long long> R2(N, N + 1);
  vector<long long> dp(N + 1, N * 2);
  dp[N] = 0;
  vector<long long> C(26, 0);
  long long r = 0;
  long long d = 0;
  long long x = 0;
  long long y;
  map<long long, vector<long long> > mp;
  mp[0].push_back(N);
  for (long long i = 0; i < N; i++) {
    R2[i] = i + 1;
  }
  long long tt;
  for (long long i = N - 1; i >= 0; i--) {
    y = (long long)1 << (long long)(S[i] - 'a');
    for (long long k = 0; k < 26; k++) {
      tt = (x ^ y) ^ ((long long)1 << k);
      if (mp.count(tt) != 0) {
        R2[i] = mp[tt][0];
      }
    }
    x = x ^ y;
    mp[x].push_back(i);
  }
  mp.clear();
  mp[0].push_back(0);
  x = 0;
  for (long long i = 0; i < N; i++) {
    y = (long long)1 << (long long)(S[i] - 'a');
    if (mp.count(x ^ y) != 0) {
      R[mp[x ^ y].back()] = i + 1;
    }
    x = x ^ y;
    mp[x].push_back(i + 1);
  }
  for (long long i = 0; i < N; i++) {
  }
  long long t = N;
  for (long long i = N - 1; i >= 0; i--) {
    if (R[i] == t) {
      dp[i] = 1;
      if (i > 0) {
        dp[i - 1] = 1;
      }
      t = i;
    }
  }
  for (long long i = N - 1; i >= 0; i--) {
    if (R[i] > N) {
      dp[i] = min(min(dp[i + 1] + 1, dp[i]), dp[R2[i]] + 1);
    } else {
      if (R[i] == N) {
        dp[i] = 1;
        if (i > 0) {
          dp[i - 1] = 1;
        }
      } else {
        dp[i] = min(min(dp[i], dp[R2[i]] + 1), min(dp[i + 1] + 1, dp[R[i]]));
      }
    }
  }
  for (long long i = 0; i < N; i++) {
  }
  return dp[0];
}
XorShift rnd;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  cout << solve(S) << endl;
}
