#include <bits/stdc++.h>
using namespace std;
bool fun(int* mozi, int size) {
  bool flag = false;
  for (int i = 0; i < (26); ++i) {
    if (mozi[i] % 2 == 0)
      continue;
    else if (flag == false)
      flag = true;
    else
      return false;
  }
  return true;
}
int main() {
  string maeori;
  cin >> maeori;
  string usiro = "";
  string mae(maeori);
  int maemozi[26] = {};
  int usiromozi[26] = {};
  for (int i = 0; i < (((long long)mae.size())); ++i) {
    maemozi[mae[i] - 'a']++;
  }
  int i;
  int count1 = 1;
  while (1) {
    if (fun(maemozi, ((long long)mae.size()))) break;
    i = ((long long)mae.size()) - 1;
    while (!fun(maemozi, ((long long)mae.size()))) {
      usiro += mae[i];
      usiromozi[mae[i] - 'a']++;
      maemozi[mae[i] - 'a']--;
      mae.erase(begin(mae) + i);
      i--;
    }
    count1++;
    mae.erase(begin(mae), end(mae));
    mae += usiro;
    usiro.erase(begin(usiro), end(usiro));
    for (int i = 0; i < (26); ++i) {
      maemozi[i] = usiromozi[i];
      usiromozi[i] = 0;
    }
  }
  string mae2(maeori);
  reverse(begin(mae2), end(mae2));
  for (int i = 0; i < (26); ++i) {
    maemozi[i] = 0;
    usiromozi[i] = 0;
  }
  for (int i = 0; i < (((long long)mae2.size())); ++i) {
    maemozi[mae2[i] - 'a']++;
  }
  int count2 = 1;
  while (1) {
    if (fun(maemozi, ((long long)mae2.size()))) break;
    i = ((long long)mae2.size()) - 1;
    while (!fun(maemozi, ((long long)mae2.size()))) {
      usiro += mae2[i];
      usiromozi[mae2[i] - 'a']++;
      maemozi[mae2[i] - 'a']--;
      mae2.erase(begin(mae2) + i);
      i--;
    }
    count2++;
    mae2.erase(begin(mae2), end(mae2));
    mae2 += usiro;
    usiro.erase(begin(usiro), end(usiro));
    for (int i = 0; i < (26); ++i) {
      maemozi[i] = usiromozi[i];
      usiromozi[i] = 0;
    }
  }
  cout << min(count1, count2);
  return 0;
}
