#include <bits/stdc++.h>
using namespace std;
int dp[200010] = {};
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.size() + 10; i++) {
    dp[i] = i;
  }
  for (int i = 2; i <= s.size(); i++) {
    int b = 0;
    for (int j = 0; j < i; j++) {
      b ^= (2 << (s[i - j - 1] - 'a'));
      if (__builtin_popcount(b) <= 1) {
        dp[i] = min(dp[i], dp[i - j - 1] + 1);
      }
    }
  }
  cout << dp[s.size()] << endl;
}
