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