#include <bits/stdc++.h>
using namespace std;
long long inf = 100000000000007;
string alph("abcdefghijklmnopqrstuvwxyz");
struct edge {
  long long to, cost;
};
vector<edge> G[22];
char fi[1005][1005];
pair<long long, long long> sg[10];
long long d[1005][1005];
long long dx[4] = {1, 0, -1, 0};
long long dy[4] = {0, 1, 0, -1};
long long c = 0;
long long n, m, t;
bool check(string s) {
  long long num[26] = {};
  long long n = 0;
  for (long long i = 0; i < s.length(); i++) {
    for (long long j = 0; j < 26; j++) {
      if (s[i] == alph[j]) {
        num[j]++;
        break;
      }
    }
  }
  for (long long i = 0; i < 26; i++) {
    if (num[i] % 2 == 1) n++;
  }
  if (n <= 1)
    return true;
  else
    return false;
}
long long solve(string s) {
  long long count = 114514;
  if (check(s)) {
    return 1;
  } else {
    string r;
    for (long long i = 0; i < s.length(); i++) {
      r += s[i];
      if (check(r)) {
        string g;
        for (long long j = i + 1; j < s.length(); j++) {
          g += s[j];
        }
        count = min(count, solve(r) + solve(g));
      }
    }
  }
  return count;
}
signed main() {
  string s;
  cin >> s;
  cout << solve(s) << endl;
  return 0;
}
