#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long linf = 1LL << 62;
const int MAX = 510000;
long long dy[8] = {0, -1, 0, 1, 1, -1, 1, -1};
long long dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const double pi = acos(-1);
const double eps = 1e-7;
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
  if (a > b) {
    a = b;
    return true;
  } else
    return false;
}
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
  if (a < b) {
    a = b;
    return true;
  } else
    return false;
}
template <typename T>
inline void print(T &a) {
  for (int i = 0; i < (a.size()); i++) cout << a[i] << " ";
  cout << "\n";
}
template <typename T1, typename T2>
inline void print2(T1 a, T2 b) {
  cout << a << " " << b << "\n";
}
template <typename T1, typename T2, typename T3>
inline void print3(T1 a, T2 b, T3 c) {
  cout << a << " " << b << " " << c << "\n";
}
long long pcount(long long x) { return __builtin_popcountll(x); }
const long long mod = 1e9 + 7;
int dp[202020];
map<vector<int>, vector<int>> mp;
string s;
int n;
vector<vector<int>> v(202020, vector<int>(26, 0));
int rec(int id) {
  if (id == n) return 0;
  if (dp[id] != -1) return dp[id];
  auto a = mp[v[id]];
  int res = inf;
  if (upper_bound((a).begin(), (a).end(), id) != a.end()) {
    chmin(res, rec(*a.rbegin()) + 1);
  }
  auto v_ = v[id];
  for (int i = 0; i < (26); i++) {
    v_[i] ^= 1;
    auto b = mp[v_];
    if (upper_bound((b).begin(), (b).end(), id) != b.end()) {
      chmin(res, rec(*b.rbegin()) + 1);
    }
    v_[i] ^= 1;
  }
  return dp[id] = res;
}
int main() {
  cin >> s;
  n = s.size();
  for (int i = 0; i < (n); i++) {
    mp[v[i]].push_back(i);
    v[i + 1] = v[i];
    v[i + 1][s[i] - 'a'] ^= 1;
    dp[i] = -1;
  }
  mp[v[n]].push_back(n);
  cout << rec(0) << "\n";
}
