#include <bits/stdc++.h>
using namespace std;
string S;
int N;
int dp[214514];
vector<int> G[214514];
map<int, int> fs[28];
void init() {
  for (int i = 0; i < 27; i++) fs[i][0] = N;
  int bit[26] = {};
  for (int i = N - 1; i > -1; i--) {
    int c = S[i] - 'a';
    for (int j = 0; j < 27; j++) {
      if (j != c) {
        if ((bit[j] & (1 << c))) {
          bit[j] &= (~(1 << c));
        } else {
          bit[j] |= (1 << c);
        }
      }
      if (fs[j].count(bit[j])) {
        G[i].emplace_back(fs[j][bit[j]]);
      } else {
        fs[j][bit[j]] = i;
      }
      G[i].emplace_back(i + 1);
    }
  }
}
int main() {
  cin >> S;
  N = S.size();
  fill(dp, dp + N + 1, (1 << 29));
  init();
  dp[0] = 0;
  for (int i = 0; i < N; i++) {
    if (dp[0] > N) continue;
    for (int to : G[i]) {
      dp[to] = min(dp[to], dp[i] + 1);
    }
  }
  cout << dp[N] << endl;
}
