#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  cin >> s;
  int n = s.size();
  int i = 0;
  int j = n - 1;
  int ans = 0;
  while (i <= j) {
    int cnt = 0;
    int a[26] = {};
    int left = i;
    for (int ii = (i); ii < (j); ii++) {
      a[s[ii] - 'a']++;
      if (a[s[ii] - 'a'] % 2)
        cnt++;
      else
        cnt--;
      if (cnt <= 1) left = max(left, ii);
    }
    int cnt2 = 0;
    int a2[26] = {};
    int right = j;
    for (int jj = j; jj >= i; jj--) {
      a2[s[jj] - 'a']++;
      if (a2[s[jj] - 'a'] % 2)
        cnt2++;
      else
        cnt2--;
      if (cnt2 <= 1) right = min(right, jj);
    }
    if (j - right <= left - i) {
      i = left + 1;
    } else {
      j = right - 1;
    }
    ans++;
  }
  cout << ans << endl;
  return 0;
}
