#include <bits/stdc++.h>
using namespace std;
string s;
vector<long long> pos[26];
long long dp[200200];
bool kai(long long l, long long r) {
  if (l == r) return true;
  bool ki = false;
  for (long long c = 0; c < (26); ++c) {
    long long num = upper_bound(pos[c].begin(), pos[c].end(), r) -
                    lower_bound(pos[c].begin(), pos[c].end(), l);
    if (num % 2 == 1) {
      if (ki) return false;
      ki = true;
    }
  }
  return true;
}
signed main() {
  cin >> s;
  for (long long i = 0; i < (s.size()); ++i) {
    pos[s[i] - 'a'].push_back(i);
  }
  for (long long i = s.size() - 1; i >= 0; --i) {
    dp[i] = s.size() - i;
    for (long long j = s.size() - 1; j >= i; --j) {
      if (kai(i, j)) {
        if (j == s.size() - 1) {
          dp[i] = 1;
          break;
        } else if (dp[j + 1] + 1 < dp[i]) {
          dp[i] = dp[j + 1] + 1;
        }
      }
    }
  }
  cout << dp[0];
}
