#include <bits/stdc++.h>
using namespace std;
int inf = (1e9);
bool c(string s) {
  int n = s.size();
  for (int i = 0; i < n; i++) {
    if (s[i] != s[n - 1 - i]) return false;
  }
  return true;
}
string func(string s) {
  string t = "";
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != 'x') t += s[i];
  }
  return t;
}
bool ff(vector<int> a) {
  int cnt = 0;
  for (int i = 0; i < 26; i++) {
    if (a[i] % 2 == 1) cnt++;
  }
  if (cnt > 1) return false;
  return true;
}
vector<int> ff2(string s) {
  vector<int> a(26, 0);
  for (int i = 0; i < s.size(); i++) {
    a[s[i] - 'a']++;
  }
  int cnt = 0;
  for (int i = 0; i < 26; i++) {
    if (a[i] % 2 == 1) cnt++;
  }
  return a;
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> a = ff2(s);
  vector<vector<int> > dp(n + 1, vector<int>(26, 0));
  for (int i = 0; i < n; i++) {
    if (i != 0) dp[i + 1] = dp[i];
    dp[i + 1][s[i] - 'a']++;
  }
  vector<int> dpa(n + 1, inf);
  dpa[0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 1; j < n - i + 1; j++) {
      int cnt = 0;
      for (int k = 0; k < 26; k++) {
        if ((dp[i + j][k] - dp[i][k]) % 2 == 1) cnt++;
      }
      if (cnt <= 1)
        dpa[i + j] = min(dpa[i + j], dpa[i] + 1);
      else
        break;
    }
  }
  cout << dpa[n] << endl;
  return 0;
}
