#include <bits/stdc++.h>
using namespace std;
char s[(200005)];
int dp[(200005)];
int dfs(int a) {
  if (dp[a] != 0) return dp[a];
  if (a == strlen(s) - 1) return 1;
  char c[300];
  memset(c, 0, 300);
  int odds = 0;
  int min = (200005);
  for (int i = a; i < strlen(s); i++) {
    c[s[i]]++;
    if (c[s[i]] % 2 == 1)
      odds++;
    else
      odds--;
    if (odds <= 1) {
      if (i == strlen(s) - 1) return 1;
      int tmp = 1 + dfs(i + 1);
      if (min > tmp) min = tmp;
    }
  }
  dp[a] = min;
  return min;
}
int main(void) {
  cin >> s;
  int ans = dfs(0);
  cout << ans << endl;
  return 0;
}
