#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
template <typename T>
class Dijk {
 private:
  ll n;
  vector<vector<pair<ll, T>>> v;

 public:
  T INF;
  Dijk(const vector<vector<pair<ll, T>>> &v, T INF) {
    this->n = v.size();
    this->v = v;
    this->INF = INF;
  }
  vector<ll> dijk(ll start) {
    vector<ll> d(n, INF);
    d[start] = 0;
    priority_queue<pair<ll, T>, vector<pair<ll, T>>,
                   function<bool(pair<ll, T>, pair<ll, T>)>>
        q([&](pair<ll, T> a, pair<ll, T> b) { return a.second > b.second; });
    q.push(pair<ll, T>(start, 0));
    while (q.size()) {
      pair<ll, T> now = q.top();
      q.pop();
      if (d[now.first] < now.second) {
        continue;
      }
      for (auto next : v[now.first]) {
        if (d[next.first] == INF ||
            d[now.first] + next.second < d[next.first]) {
          d[next.first] = d[now.first] + next.second;
          q.push(pair<ll, T>(next.first, d[now.first] + next.second));
        }
      }
    }
    return d;
  }
};
ll to_num(const array<ll, 26> &arr) {
  ll ret = 0;
  for (ll i = 0; i < 26; i++)
    if (arr[i] & 1) ret += (1 << i);
  return ret;
}
ll back(const vector<ll> &v) {
  if (v.size() == 0) return -1;
  return v[v.size() - 1];
}
int main() {
  string s;
  cin >> s;
  map<ll, vector<ll>> ma;
  ma[0].push_back(0);
  vector<ll> nodes = {0};
  vector<array<ll, 26>> sum(s.size());
  for (ll i = 0; i < 26; i++) sum[0][i] = (i == s[0] - 'a');
  for (ll i = 1; i < s.size(); i++) {
    for (ll j = 0; j < 26; j++) sum[i][j] += sum[i - 1][j];
    sum[i][s[i] - 'a']++;
  }
  for (ll i = 0; i < sum.size(); i++) {
    ll num = to_num(sum[i]);
    nodes.push_back(num);
    ma[num].push_back(i + 1);
  }
  vector<vector<pair<ll, ll>>> edges(nodes.size());
  for (ll i = 0; i < nodes.size(); i++) {
    for (ll j = -1; j < 26; j++) {
      ll tmp = nodes[i];
      if (j >= 0) tmp ^= (1 << j);
      ll to = back(ma[tmp]);
      if (to != -1 && to > i) edges[i].push_back(pair<ll, ll>(to, 1));
    }
  }
  Dijk<ll> D(edges, 5e15);
  auto d = D.dijk(0);
  cout << d[nodes.size() - 1] << endl;
  return 0;
}
