#include <bits/stdc++.h>
const int INF = 1e8;
using namespace std;
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  cout << '(' << p.first << ' ' << p.second << ')';
  return os;
}
template <typename T>
void dpite(T a, T b) {
  return;
}
template <typename T>
void pite(T a, T b) {
  for (T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite;
  cout << '\n';
}
template <typename T>
bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
void ios_init() {
  ios::sync_with_stdio(false);
  cin.tie(0);
}
int main() {
  ios_init();
  string s;
  while (cin >> s) {
    int n = s.size();
    using bs = bitset<26>;
    map<unsigned long long, vector<int>> mp;
    mp[0].push_back(0);
    vector<vector<int>> dp(n + 1, vector<int>(26, INF));
    vector<int> dpp(n + 1, INF);
    dp[0] = vector<int>(26, 0);
    dpp[0] = 0;
    bs tmp = 0;
    bs ex = 0;
    for (int i = (0); i < (int((s).size())); ++i) {
      int c = s[i] - 'a';
      tmp[c] = !tmp[c];
      ex[c] = true;
      for (int j = (0); j < (26); ++j) {
        if (!ex[j]) continue;
        true;
        true;
        bs t = tmp;
        true;
        t[j] = !t[j];
        auto ite = mp.find(t.to_ullong());
        int f;
        if (ite != mp.end()) {
          f = ite->second[0];
          true;
        } else {
          f = i;
        }
        int mi = INF;
        for (int k = (0); k < (26); ++k) {
          chmin(mi, dp[f][k]);
        }
        chmin(mi, dpp[f]);
        dp[i + 1][j] = mi + 1;
      }
      {
        bs t = tmp;
        auto ite = mp.find(t.to_ullong());
        int f;
        if (ite != mp.end()) {
          f = ite->second[0];
          true;
        } else {
          f = i;
        }
        chmin(dpp[i + 1], dpp[f] + 1);
      }
      mp[tmp.to_ullong()].push_back(i + 1);
    }
    for (auto&& e : mp) {
      true;
      dpite((e.second).begin(), (e.second).end());
    }
    int ans = INF;
    for (auto&& e : dp) {
      dpite((e).begin(), (e).end());
    }
    dpite((dpp).begin(), (dpp).end());
    for (int i = (0); i < (26); ++i) {
      chmin(ans, dp.back()[i]);
    }
    chmin(ans, dpp.back());
    cout << ans << '\n';
  }
  return 0;
}
