#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f2f1f0f;
const long long LINF = 1ll * INF * INF;
const int MAX_N = 2e5 + 100;
int N;
char S[MAX_N];
int Cnt[26][MAX_N];
int Dy[1 << 26], Ans[MAX_N];
int main() {
  scanf("%s", S + 1);
  N = strlen(S + 1);
  for (int i = 1; i <= N; i++) {
    for (int k = 0; k < 26; k++) Cnt[k][i] = Cnt[k][i - 1];
    int k = S[i] - 'a';
    Cnt[k][i] = 1 - Cnt[k][i];
  }
  for (int s = 0; s < (1 << 26); s++) Dy[s] = INF;
  for (int i = 1; i <= N; i++) Ans[i] = INF;
  Ans[0] = 0;
  for (int i = 1; i <= N; i++) {
    int s = 0;
    for (int k = 0; k < 26; k++) {
      s += Cnt[k][i] << k;
    }
    Ans[i] = min(Ans[i], Ans[i - 1] + 1);
    Dy[s] = min(Dy[s], Ans[i - 1] + 1);
    for (int ch = 0; ch < 26; ch++) {
      int ns = s ^ (1 << ch);
      Ans[i] = min(Ans[i], Dy[ns] + 1);
    }
  }
  printf("%d\n", Ans[N]);
  return 0;
}
