#include <bits/stdc++.h>
using namespace std;
int D[26][200001] = {};
int dp[200001] = {};
char alp[] = "abcdefghijklmnopqrstuvwxyz";
const int INF = 2000001;
int calc(int e) {
  if (e == 0) return 0;
  if (dp[e] > 0) return dp[e];
  dp[e] = INF;
  for (int i = 1; i < e + 1; ++i) {
    int p = 0;
    for (int j = 0; j < 26; ++j) {
      if ((D[j][e] - D[j][i - 1]) % 2 == 1) ++p;
    }
    if (p < 2) dp[e] = min(dp[e], 1 + calc(i - 1));
  }
  return dp[e];
}
int main() {
  string S;
  cin >> S;
  for (int i = 1; i < S.size() + 1; ++i) {
    for (int j = 0; j < 26; ++j) {
      D[j][i] = D[j][i - 1];
      if (S[i - 1] == alp[j]) ++D[j][i];
    }
  }
  cout << calc(S.size()) << endl;
  return 0;
}
