#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000;
const double PI = acos(-1);
int num_edge = 0, head[100000];
struct Edge {
  int nxt, to;
} edge[100000];
LL n, m, sum = 0, f[1000000] = {}, W[1000][1000] = {}, now = 0;
string S, str[1000000];
void add_edge(int from, int to) {
  edge[++num_edge].nxt = from;
  edge[num_edge].to = to;
  head[from] = num_edge;
}
bool ff(string str) {
  int f[100000] = {}, Sum = 0;
  for (LL i = 0; i < str.size(); i++) {
    f[str[i] - 'a'] += 1;
  }
  for (int i = 0; i < 26; i++)
    if (f[i] % 2 == 1) Sum++;
  return Sum > 1 ? false : true;
}
LL dp[300000];
char c;
int main() {
  cin >> S;
  n = 0;
  m = 0;
  for (LL i = 0; i < 30000; i++) dp[i] = INF;
  dp[0] = 0;
  for (LL i = 0; i < S.size(); i++) {
    string ss;
    for (int j = 0; j < 26; ++j) f[j] = 0;
    for (LL j = i; j < S.size(); j++) {
      int Sum = 0;
      f[S[j] - 'a'] += 1;
      for (int h = 0; h < 26; h++)
        if (f[h] % 2 == 1) Sum++;
      if (Sum <= 1) {
        dp[j + 1] = min(dp[j] + 1, min(dp[i] + 1, dp[j + 1]));
      }
      dp[j + 1] = min(dp[j] + 1, dp[j + 1]);
    }
  }
  cout << dp[S.size()] << endl;
  return 0;
}
