// Copyright (C) 2017 Sayutin Dmitry.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; version 3

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; If not, see <http://www.gnu.org/licenses/>.

#include <iostream>
#include <vector>
#include <stdint.h>
#include <algorithm>
#include <set>
#include <map>
#include <array>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#include <string>
#include <assert.h>
#include <iterator>
#include <cstdint>
#include <cinttypes>
#include <string.h>
#include <random>
#include <numeric>
#include <tuple>


using std::cin;
using std::cout;
using std::cerr;

using std::vector;
using std::map;
using std::array;
using std::set;
using std::string;

using std::pair;
using std::make_pair;

using std::min;
using std::abs;
using std::max;

using std::unique;
using std::sort;
using std::generate;
using std::reverse;
using std::min_element;
using std::max_element;

#ifdef LOCAL
#define LASSERT(X) assert(X)
#else
#define LASSERT(X) {}
#endif

template <typename T>
T input() {
    T res;
    cin >> res;
    LASSERT(cin);
    return res;
}

template <typename IT>
void input_seq(IT b, IT e) {
    std::generate(b, e, input<typename std::remove_reference<decltype(*b)>::type>);
}

#define SZ(vec)         int((vec).size())
#define ALL(data)       data.begin(),data.end()
#define RALL(data)      data.rbegin(),data.rend()
#define TYPEMAX(type)   std::numeric_limits<type>::max()
#define TYPEMIN(type)   std::numeric_limits<type>::min()

#define pb push_back
#define eb emplace_back

int solve(const string& s) {
    std::map<uint32_t, int> fst, lst;

    vector<uint32_t> f(SZ(s) + 1);
    f[0] = 0;

    fst[0] = 0;
    
    for (int i = 0; i != SZ(s); ++i) {
        f[i + 1] = f[i];
        f[i + 1] ^= (1 << (s[i] - 'a'));

        if (not fst.count(f[i + 1]))
            fst[f[i + 1]] = i + 1;
        lst[f[i + 1]] = i + 1;
    }

    vector<int> dp(SZ(s) + 1, TYPEMAX(int) / 2);
    dp[0] = 0;
    for (int i = 0; i != SZ(s); ++i) {
        dp[i + 1] = 1 + dp[i];
        
        auto cur = f[i + 1];
        
        if (fst.count(cur))
            dp[i + 1] = min(dp[i + 1], 1 + dp[fst[cur]]);
        
        for (int let = 0; let != 26; ++let) {
            auto go = cur ^ (1 << let);
            if (fst.count(go))
                dp[i + 1] = min(dp[i + 1], 1 + dp[fst[go]]);
            if (lst.count(go))
                dp[i + 1] = min(dp[i + 1], 1 + dp[lst[go]]);
        }
    }

    return dp.back();
}

int solve_st(const string& s) {
    vector<int> dp(SZ(s), TYPEMAX(int));

    for (int i = 0; i != SZ(s); ++i) {
        uint32_t mask = 0;
        for (int j = i; j >= 0; --j) {
            mask ^= (1 << (s[j] - 'a'));

            if (__builtin_popcount(mask) <= 1)
                dp[i] = min(dp[i], 1 + (j == 0 ? 0 : dp[j - 1]));
        }
    }

    return dp.back();
}

int main() {
    std::iostream::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    
    // code here.
#ifndef LOCAL
    string s = input<string>();
    
    cout << solve(s) << "\n";
#else
    std::mt19937 rnd(228);
    while (true) {
        int n = 1 + (rnd() % 100);
        string s = "";
        for (int i = 0; i != n; ++i)
            s += std::uniform_int_distribution<char>('a', 'z')(rnd);

        if (solve(s) != solve_st(s)) {
            cout << "FAIL" << std::endl;
            cout << s << std::endl;
            cout << solve(s) << std::endl;
            cout << solve_st(s) << std::endl;
        }
    }
#endif
    
    return 0;
}


Measured memory_bytes: 20756