#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;
map<vector<int>, int> mp;
vector<vector<int>> v(202020, vector<int>(26, 0));
int main() {
  string s;
  cin >> s;
  int n = s.size();
  mp[v[0]] = 0;
  vector<int> dp(n, inf);
  for (int i = 0; i < (n); i++) {
    v[i + 1] = v[i];
    v[i + 1][s[i] - 'a'] ^= 1;
    auto v_ = v[i + 1];
    for (int j = 0; j < (26); j++) {
      v_[j] ^= 1;
      if (mp.find(v_) != mp.end()) {
        chmin(dp[i], mp[v_] + 1);
      }
      v_[j] ^= 1;
    }
    if (mp.find(v[i + 1]) != mp.end()) {
      chmin(dp[i], mp[v[i + 1]] + 1);
    } else {
      mp[v[i + 1]] = dp[i];
    }
  }
  cout << dp[n - 1] << "\n";
}
