#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e7 + 1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
long long int n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;
map<string, string> mp, mpg, mpa;
long long int ch[26] = {0};
bool isk(string s) {
  fill_n(ch, 26, 0);
  for (long long int i = (long long int)(0); i < (long long int)(s.size());
       i++) {
    ch[s[i] - 'a']++;
  }
  long long int cn = 0;
  for (long long int i = (long long int)(0); i < (long long int)(26); i++) {
    if (ch[i] % 2 == 1) {
      cn++;
    }
  }
  if (cn == 0 || cn == 1) {
    return true;
  } else {
    return false;
  }
}
vector<long long int> va;
long long int isn(string s) {
  long long int re = s.size() + 1;
  for (long long int i = (long long int)(0); i < (long long int)(s.size());
       i++) {
    string t = s.substr(0, s.size() - i);
    if (isk(t)) {
      if (i == 0) {
        re = 1;
        return re;
      } else {
        re = min(re, va[i - 1] + 1);
      }
    }
  }
  return re;
}
int main() {
  cin >> s;
  long long int no[26] = {0};
  string t = s;
  for (long long int i = (long long int)(0); i < (long long int)(t.size());
       i++) {
    no[t[i] - 'a']++;
  }
  for (long long int i = (long long int)(0); i < (long long int)(26); i++) {
    if (no[i] % 2 == 1) {
      sum++;
    }
  }
  if (isk(s)) {
    cout << "1" << endl;
    return 0;
  }
  va.push_back(1);
  for (long long int i = (long long int)(1); i < (long long int)(s.size());
       i++) {
    if (isn(s.substr(s.size() - i - 1, s.size())) == -1) {
      va.push_back(va[i - 1] + 1);
    } else {
      va.push_back(
          min(va[i - 1] + 1, isn(s.substr(s.size() - i - 1, s.size()))));
    }
  }
  cout << va[s.size() - 1] << endl;
}
