#include <bits/stdc++.h>
using namespace std;
using LONG = long long int;
using ULONG = unsigned long long int;
constexpr int MAX_S_SIZE = 2 * 10E5;
int C[MAX_S_SIZE + 1][26];
string S;
int cutline;
void search(int start, int end, int count) {
  if (count >= cutline) return;
  int odd = 0;
  int CT[26];
  for (int i = 0; i < 26; i++) {
    CT[i] = C[end][i] - C[start][i];
    if (CT[i] % 2 != 0) odd++;
  }
  for (int tail = end; tail > start; tail--) {
    if (odd <= 1) {
      if (tail == end) {
        cutline = count;
      } else {
        search(tail, S.size(), count + 1);
      }
    }
    int idx = S[tail - 1] - 'a';
    CT[idx]--;
    if (CT[idx] % 2 == 0)
      odd--;
    else
      odd++;
  }
}
int main(void) {
  cin >> S;
  for (int i = 0; i < 26; i++) {
    C[0][i] = 0;
  }
  for (int i = 0; i < S.size(); i++) {
    for (int j = 0; j < 26; j++) {
      int cnt = S[i] == 'a' + j ? 1 : 0;
      C[i + 1][j] = C[i][j] + cnt;
    }
  }
  cutline = S.size() - 1;
  search(0, S.size(), 0);
  cout << (cutline + 1) << endl;
  return 0;
}
