#include <bits/stdc++.h>
using namespace std;
const long long INF = 1E14;
int main() {
  string S;
  cin >> S;
  int len = S.length();
  int Cnt[len + 1][26];
  for (int j = 0; j < 26; ++j) {
    Cnt[0][j] = 0;
  }
  for (int i = 1; i < S.length() + 1; ++i) {
    int tmp = S[i - 1] - 'a';
    for (int j = 0; j < 26; ++j) {
      if (tmp == j) {
        Cnt[i][j] = Cnt[i - 1][j] + 1;
      } else {
        Cnt[i][j] = Cnt[i - 1][j];
      }
    }
  }
  long long dp[len + 1];
  fill(dp, dp + len + 1, INF);
  dp[0] = 0;
  for (int i = 1; i < len + 1; ++i) {
    for (int j = 0; j < i; ++j) {
      int num = 0;
      for (int k = 0; k < 26; ++k) {
        num += (Cnt[i][k] - Cnt[j][k]) % 2;
        if (num > 1) {
          break;
        }
      }
      if (num <= 1) {
        dp[i] = min(dp[i], dp[j] + 1);
      }
    }
  }
  cout << dp[len] << endl;
}
