#include <bits/stdc++.h>
using namespace std;
int DP[200001];
int A[200001][26];
int B[200001];
int N;
string s;
int solve(int n) {
  if (DP[n] != 1e9) return DP[n];
  vector<int> C(26);
  int cnt = B[n];
  if (cnt <= 1) {
    DP[n] = min(DP[n], 1);
    return 1;
  }
  int ans = 1e8;
  for (int i = N - 1; i > n; i--) {
    int c = s[i] - 'a';
    C[c]++;
    if ((A[n][c] - C[c]) % 2) {
      cnt++;
    } else {
      cnt--;
    }
    if (cnt <= 1) {
      ans = min(ans, 1 + solve(i));
    }
  }
  DP[n] = min(DP[n], ans);
  return ans;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> s;
  N = s.size();
  for (int i = 0; i < N; i++) DP[i] = 1e9;
  int cnt = 0;
  vector<int> C(26);
  for (int i = N - 1; i >= 0; i--) {
    int c = s[i] - 'a';
    C[c]++;
    if (C[c] % 2) {
      cnt++;
    } else {
      cnt--;
    }
    B[i] = cnt;
    for (int j = 0; j < 26; j++) {
      A[i][j] = C[j];
    }
  }
  if (cnt <= 1) {
    cout << 1 << endl;
    return 0;
  }
  int ans = 1e9;
  cnt = 0;
  C.assign(26, 0);
  for (int i = 0; i < N - 1; i++) {
    int c = s[i] - 'a';
    C[c]++;
    if (C[c] % 2) {
      cnt++;
    } else {
      cnt--;
    }
    if (cnt <= 1) {
      ans = min(ans, 1 + solve(i + 1));
    }
  }
  cout << ans << endl;
  return 0;
}
