#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
long long int N, M, K, H, W, L, R;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  N = s.size();
  vector<vector<int>> num(N, vector<int>(26));
  num[0][s[0] - 'a']++;
  for (int i = 1; i < N; i++) {
    for (int j = 0; j < 26; j++) {
      num[i][j] = num[i - 1][j];
    }
    num[i][s[i] - 'a']++;
  }
  for (int i = 0; i < 26; i++) {
    if (num[N - 1][i] % 2) {
      M++;
    }
  }
  if (M < 2) {
    cout << "1\n";
    return 0;
  }
  L = 0;
  R = N - 1;
  while (R > L && M > 1) {
    bool can = false;
    for (int i = L + (R - L) / 2; i >= L; i -= 2) {
      int fig = 0;
      bool flag = false;
      int magic;
      for (int j = 0; j < 26; j++) {
        if ((num[i][j] - num[L - 1][j]) % 2) {
          fig++;
          if (fig == 2) {
            break;
          }
          if (num[N - 1][j] % 2) {
            flag = true;
            magic = j;
          } else {
            break;
          }
        }
      }
      if (flag) {
        can = true;
        L = i + 1;
        K++;
        M--;
        num[N - 1][magic]--;
        break;
      }
    }
    if (can) continue;
    for (int i = R - (R - L) / 2; i <= R; i += 2) {
      int fig = 0;
      bool flag = false;
      int magic;
      for (int j = 0; j < 26; j++) {
        if ((num[R][j] - num[i - 1][j]) % 2) {
          fig++;
          if (fig == 2) {
            break;
          }
          if (num[N - 1][j] % 2) {
            flag = true;
            magic = j;
          } else {
            break;
          }
        }
      }
      if (flag) {
        can = true;
        R = i - 1;
        K++;
        M--;
        num[N - 1][magic]--;
        break;
      }
    }
    if (can) continue;
    for (int i = L + 1 + (R - L - 1) / 2; i >= L + 1; i -= 2) {
      bool flag = true;
      int magic;
      for (int j = 0; j < 26; j++) {
        if ((num[i][j] - num[L - 1][j]) % 2) {
          if (num[N - 1][j] % 2) {
            break;
          }
        }
      }
      if (flag) {
        can = true;
        L = i + 1;
        K++;
        num[N - 1][magic]--;
        break;
      }
    }
    if (can) continue;
    for (int i = R - 1 + (R - L - 1) / 2; i <= R - 1; i += 2) {
      bool flag = true;
      int magic;
      for (int j = 0; j < 26; j++) {
        if ((num[R][j] - num[i - 1][j]) % 2) {
          if (num[N - 1][j] % 2) {
            break;
          }
        }
      }
      if (flag) {
        can = true;
        R = i - 1;
        K++;
        num[N - 1][magic]--;
        break;
      }
    }
    if (can) continue;
    for (int i = L + (R - L) / 2; i >= L; i -= 2) {
      int fig = 0;
      bool flag = false;
      int magic;
      for (int j = 0; j < 26; j++) {
        if ((num[i][j] - num[L - 1][j]) % 2) {
          fig++;
          if (fig == 2) {
            break;
          }
          flag = true;
          magic = j;
        }
      }
      if (flag) {
        can = true;
        L = i + 1;
        K++;
        M++;
        num[N - 1][magic]++;
        break;
      }
    }
    if (can) continue;
    for (int i = R - (R - L) / 2; i <= R; i += 2) {
      int fig = 0;
      bool flag = false;
      int magic;
      for (int j = 0; j < 26; j++) {
        if ((num[R][j] - num[i - 1][j]) % 2) {
          fig++;
          if (fig == 2) {
            break;
          }
          flag = true;
          magic = j;
        }
      }
      if (flag) {
        can = true;
        R = i - 1;
        K++;
        M++;
        num[N - 1][magic]++;
        break;
      }
    }
    if (can) continue;
  }
  if (R > L) {
    K++;
  }
  cout << K << endl;
  return 0;
}
