#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000000000ll;
const long long MOD = 1000000007ll;
const double EPS = 1e-8;
int cnt[1000005][26];
int calc(string s) {
  for (int i = 0; i < s.size(); i++) {
    if (i == 0) {
      cnt[i + 1][s[i] - 'a']++;
    } else {
      for (int j = 0; j < 26; j++) {
        cnt[i + 1][j] = cnt[i][j];
      }
      cnt[i + 1][s[i] - 'a']++;
    }
  }
  int ans = 0;
  for (int i = 0; i < s.size() + 1; i++) {
    int ma = 0;
    for (int j = i + 1; j < s.size() + 1; j++) {
      int now[26];
      int one = 0;
      for (int k = 0; k < 26; k++) {
        now[k] = cnt[j][k] - cnt[i][k];
        if (now[k] % 2 == 1) {
          one++;
        }
      }
      if (one > 1) {
      } else {
        ma = j - i - 1;
      }
    }
    i += ma;
    ans++;
  }
  return ans - 1;
}
int main(void) {
  string s;
  cin >> s;
  int ans1 = calc(s);
  for (int i = 0; i < 1000004; i++) {
    for (int j = 0; j < 26; j++) {
      cnt[i][j] = 0;
    }
  }
  reverse(s.begin(), s.end());
  int ans2 = calc(s);
  cout << min(ans1, ans2) << endl;
  return 0;
}
