#include <bits/stdc++.h>
using namespace std;
int memo[200001];
size_t N;
string str;
int calc(size_t h) {
  if (h == N) return 0;
  if (memo[h] != -1) return memo[h];
  int a[26];
  int k = 0;
  int m = 0xffffff;
  int largest0 = h;
  for (size_t i = 0; i < 26; i++) {
    a[i] = 0;
  }
  for (size_t i = h; i < N; i++) {
    int t = ++a[str[i] - 'a'];
    if ((t % 2) == 1)
      ++k;
    else
      --k;
    if (k == 1)
      m = min(calc(i + 1), m);
    else if (k == 0)
      largest0 = i;
  }
  return memo[h] = min(calc(h + 1), m) + 1;
}
int main() {
  for (size_t i = 0; i < 200001; i++) {
    memo[i] = -1;
  }
  cin >> str;
  N = str.size();
  cout << calc(0);
  return 0;
}
