#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int aloneCnt = 0;
  int res = 1, res2 = 1;
  int last = -1;
  int cnt[26] = {0};
  int N = 0;
  cin >> s;
  N = s.length();
  while (last < N) {
    for (int i = (last + 1); i < (N); ++i) {
      char c = s[i];
      cnt[c - 0x61]++;
      if (cnt[c - 0x61] % 2 == 1) {
        aloneCnt++;
      } else if (cnt[c - 0x61] % 2 == 0) {
        aloneCnt--;
      }
      if (aloneCnt == 0 || aloneCnt == 1) {
        last = i;
      }
    }
    if (aloneCnt == 0 || aloneCnt == 1) {
      break;
    } else {
      res++;
    }
    for (int i = (0); i < (26); ++i) {
      cnt[i] = 0;
    }
    aloneCnt = 0;
  }
  for (int i = (0); i < (26); ++i) {
    cnt[i] = 0;
  }
  aloneCnt = 0;
  last = N;
  while (last >= 0) {
    for (int i = last - 1; i >= 0; i--) {
      char c = s[i];
      cnt[c - 0x61]++;
      if (cnt[c - 0x61] % 2 == 1) {
        aloneCnt++;
      } else if (cnt[c - 0x61] % 2 == 0) {
        aloneCnt--;
      }
      if (aloneCnt == 0 || aloneCnt == 1) {
        last = i;
      }
    }
    if (aloneCnt == 0 || aloneCnt == 1) {
      break;
    } else {
      res2++;
    }
    for (int i = (0); i < (26); ++i) {
      cnt[i] = 0;
    }
    aloneCnt = 0;
  }
  if (res < res2)
    cout << res << endl;
  else
    cout << res2 << endl;
}
