#include <bits/stdc++.h>
using namespace std;
string s;
int d[200010];
int inf = 1000000000;
int sum[200010][26];
int dfs(int now) {
  if (d[now] > 0) return d[now];
  int ret = inf;
  for (int i = now; i >= 0; i--) {
    int ki = 0;
    for (int j = 0; j < 26; j++) {
      int t = sum[now + 1][j] - sum[i][j];
      ki += t % 2;
    }
    if (ki <= 1) {
      if (i == 0)
        return d[now] = 1;
      else {
        ret = min(dfs(i - 1) + 1, ret);
      }
    }
  }
  return d[now] = ret;
}
int main() {
  cin >> s;
  fill(d, d + 200010, -1);
  for (int i = 0; i < 200010; i++) fill(sum[i], sum[i] + 26, 0);
  for (int i = 0; i < s.size(); i++) {
    for (int j = 0; j < 26; j++) sum[i + 1][j] = sum[i][j];
    sum[i + 1][s[i] - 'a']++;
  }
  int ans = dfs(s.size() - 1);
  cout << ans << endl;
}
