#include <iostream>
#include <vector>
#include <algorithm>
#include <array>
#include <set>
#include <map>
#include <queue>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <functional>
#include <cassert>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define repeat_from(i, m, n) for (int i = (m); (i) < int(n); ++(i))
#define repeat_reverse(i, n) for (int i = (n)-1; (i) >= 0; --(i))
#define repeat_from_reverse(i, m, n) for (int i = (n)-1; (i) >= int(m); --(i))
#define whole(x) begin(x), end(x)
#define unittest_name_helper(counter) unittest_ ## counter
#define unittest_name(counter) unittest_name_helper(counter)
#define unittest __attribute__((constructor)) void unittest_name(__COUNTER__) ()
using ll = long long;
using namespace std;

constexpr int inf = 1e9+7;
int main() {
    string s; cin >> s;
    int n = s.length();
    vector<int32_t> xoracc(n + 1);
    repeat (i, n) {
        xoracc[i + 1] = xoracc[i] ^ (1 << (s[i] - 'a'));
    }
    vector<int> dp(n + 1, inf);
    dp[0] = 0;
    repeat (r, n) {
        repeat (l, r + 1) {
            if (__builtin_popcount(xoracc[r + 1] ^ xoracc[l]) <= 1) {
                setmin(dp[r + 1], dp[l] + 1);
            }
        }
    }
    cout << dp[n] << endl;
    return 0;
}
