#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 5;
const int INF = 1 << 30;
int preS[26][N], dp[N], pivot[N];
inline int get_sum(char, int, int);
inline bool canPali(int, int);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string ss;
  cin >> ss;
  int n = ss.size();
  for (int i = 0; i < n; i++) {
    preS[ss[i] - 'a'][i + 1]++;
  }
  for (int i = 0; i < 26; i++)
    for (int j = 1; j <= n; j++) {
      preS[i][j] += preS[i][j - 1];
    }
  fill(dp + 1, dp + n + 1, INF);
  for (int i = 1; i <= n; i++) {
    dp[i] = dp[i - 1] + 1;
    pivot[i] = i - 1;
    for (int j = 0; j <= pivot[i - 1]; j++) {
      if (canPali(j, i)) {
        if (dp[j] + 1 < dp[i]) {
          dp[i] = dp[j] + 1;
          pivot[i] = j;
        }
      }
    }
  }
  cout << dp[n] << '\n';
  return 0;
}
inline int get_sum(char c, int l, int r) {
  return preS[c - 'a'][r] - preS[c - 'a'][l];
}
inline bool canPali(int l, int r) {
  int cnt = 0;
  for (int i = 0; i < 26; i++) {
    if (get_sum('a' + i, l, r) & 1) {
      cnt++;
    }
  }
  return cnt <= 1;
}
