#include <bits/stdc++.h>
using namespace std;
char s[200020];
int cnt[256];
int sum[200020];
int f[200020];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  for (int i = 1; i <= n; i++) {
    int ind = s[i] - 'a';
    cnt[ind]++;
    sum[i] = sum[i - 1];
    if ((cnt[ind] & 1) == 1)
      sum[i]++;
    else
      sum[i]--;
  }
  for (int i = 1; i <= n; i++) {
    f[i] = 0x7fffffff;
    for (int j = i - 1; j >= 0; j--)
      if (sum[i] >= sum[j] && sum[i] - sum[j] <= 1) {
        f[i] = min(f[i], f[j] + 1);
        break;
      }
  }
  printf("%d\n", f[n]);
  return 0;
}
