#include <bits/stdc++.h>
using namespace std;
int reps[27][200005];
int dp[200005];
string t;
char s[200005];
int str;
bool valid(int start, int en) {
  bool odds = false;
  for (int i = 0; i <= 26; i++) {
    int diff = reps[i][en] - reps[i][start - 1];
    if ((diff % 2) == 0) continue;
    if (odds) return false;
    odds = true;
  }
  return true;
}
int solve(int idx) {
  if (idx == str + 1) return 0;
  if (dp[idx] != -1) return dp[idx];
  int C1 = 1e9;
  for (int i = idx; i <= str; i++) {
    if (valid(idx, i)) C1 = min(C1, 1 + solve(i + 1));
  }
  return dp[idx] = C1;
}
int main() {
  memset(dp, -1, sizeof dp);
  cin >> t;
  str = t.length();
  for (int i = 1; i <= str; i++) s[i] = t[i - 1];
  for (int i = 1; i <= str; i++) reps[s[i] - 'a'][i]++;
  for (int i = 0; i <= 26; i++) {
    for (int j = 1; j <= 2e5; j++) reps[i][j] += reps[i][j - 1];
  }
  cout << solve(0);
}
