#include <bits/stdc++.h>
using namespace std;
template <class C>
void mini(C& _a4, C _b4) {
  _a4 = min(_a4, _b4);
}
template <class C>
void maxi(C& _a4, C _b4) {
  _a4 = max(_a4, _b4);
}
template <class TH>
void _dbg(const char* sdbg, TH h) {
  cerr << sdbg << '=' << h << endl;
}
template <class TH, class... TA>
void _dbg(const char* sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << '=' << h << ',';
  _dbg(sdbg + 1, a...);
}
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
  os << "[";
  for (auto& vv : V) os << vv << ",";
  os << "]";
  return os;
}
ostream& operator<<(ostream& os, vector<bool> V) {
  os << "[";
  for (long long i = (0); i <= ((long long)(26) - 1); i++) {
    if (V[i]) {
      os << (char)('a' + i) << ",";
    }
  }
  os << "]";
  return os;
}
template <class L, class R>
ostream& operator<<(ostream& os, map<L, R> V) {
  os << "[";
  for (auto& vv : V) os << vv << ",";
  os << "]";
  return os;
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <typename Out>
void split(const std::string& s, char delim, Out result) {
  std::stringstream ss(s);
  std::string item;
  while (std::getline(ss, item, delim)) {
    *(result++) = item;
  }
}
std::vector<std::string> split(const std::string& s, char delim) {
  std::vector<std::string> elems;
  split(s, delim, std::back_inserter(elems));
  return elems;
}
void trim(string& s) {
  long long idx = 0;
  long long n = s.size();
  for (long long i = (0); i <= ((long long)(n)-1); i++) {
    if (s[i] != ' ' && s[i] != '\t') {
      s = s.substr(i);
      break;
    }
  }
  while (!s.empty()) {
    if (s.back() == ' ' || s.back() == '\t') {
      s.pop_back();
    } else {
      break;
    }
  }
}
int32_t main(int32_t argc, char** argv) {
  ios_base::sync_with_stdio(0);
  string s;
  cin >> s;
  string res;
  map<vector<bool>, long long> m;
  vector<bool> acc(26);
  long long nonEmpty = 0;
  long long lastRes = INT_MAX;
  for (char c : s) {
    acc[c - 'a'].flip();
    if (acc[c - 'a']) {
      nonEmpty++;
    } else {
      nonEmpty--;
    }
    if (nonEmpty <= 1) {
      m[acc] = 1;
      lastRes = 1;
      continue;
    }
  nxt:;
    lastRes = INT_MAX;
    if (m.count(acc)) {
      lastRes = m[acc] + 1;
    }
    for (long long i = (0); i <= ((long long)(26) - 1); i++) {
      acc[i].flip();
      if (m.count(acc)) {
        long long v = m[acc];
        mini(lastRes, v + 1);
        acc[i].flip();
        if (m.count(acc)) {
          mini(m[acc], v + 1);
        } else {
          m[acc] = v + 1;
        }
        acc[i].flip();
      }
      acc[i].flip();
    }
  }
  cout << lastRes;
}
