#include <bits/stdc++.h>

#define show(x) cerr << #x << " = " << x << endl

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "sz:" << v.size() << "\n[";
    for (const auto& p : v) {
        os << p << ",";
    }
    os << "]\n";
    return os;
}

template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p)
{
    os << "(" << p.first << "," << p.second
       << ")";
    return os;
}


constexpr ll MOD = (ll)1e9 + 7LL;

template <typename T>
constexpr T INF = numeric_limits<T>::max() / 100;

template <typename Base>
class BinaryIndexedTree
{
public:
    using T = typename Base::T;
    using AbelGroup = Base;

    BinaryIndexedTree(const int n) : data_num(n), size(1 << (__lg(2 * data_num - 1))), value(size + 1, AbelGroup::identity()) { assert(n > 0); }
    BinaryIndexedTree(const vector<T>& val) : data_num(val.size()), size(1 << (__lg(2 * data_num - 1))), value(size + 1, AbelGroup::identity())
    {
        for (int i = 1; i <= size; i++) {
            value[i] = val[i - 1];
        }
        for (int x = 1; x < size; x++) {
            value[x + (x & -x)] += value[x];
        }
    }

    T accumulate(const int a) const
    {
        assert(0 <= a and a < data_num);
        int ind = a + 1;
        T sum = AbelGroup::identity();
        while (ind > 0) {
            sum = op(sum, value[ind]);
            ind &= ind - 1;
        }
        return sum;
    }

    void add(const int a, const T& val)
    {
        assert(0 <= a and a < data_num);
        int ind = a + 1;
        while (ind <= size) {
            value[ind] = op(value[ind], val);
            ind += ind & (-ind);
        }
    }

    void set(const int a, const T& val)
    {
        const int v = get(a);
        add(a, op(val, op.inv(v)));
    }

    T get(const int a) const
    {
        assert(0 <= a and a < data_num);
        if (a == 0) {
            return accumulate(a);
        } else {
            return op(op.inv(accumulate(a - 1)), accumulate(a));
        }
    }

    int lowerBound(T w) const
    {
        if (w <= AbelGroup::identity()) {
            return 0;
        }
        int x = 0;
        for (int k = ((size == data_num) ? size : size / 2); k > 0; k /= 2) {
            if (x + k <= size and value[x + k] < w) {
                w = op(w, op.inv(value[x + k]));
                x += k;
            }
        }
        return x;
    }

private:
    const int data_num;
    const int size;
    const AbelGroup op{};
    vector<T> value;
};
struct Sum {
    using T = bool;
    T operator()(const T& a, const T& b) const
    {
        return a xor b;
    }
    T inv(const T& a) const
    {
        return (not a);
    }
    static constexpr T identity()
    {
        return false;
    }
};


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    string s;
    cin >> s;
    const int N = s.size();

    using BIT = BinaryIndexedTree<Sum>;
    vector<BIT> bits(26, BIT(N));

    for (int i = 0; i < N; i++) {
        bits[s[i] - 'a'].add(i, 1);
    }

    ll sum = 0;
    for (int i = 0; i < 26; i++) {
        sum += (ll)bits[i].accumulate(N - 1);
    }
    if (sum <= 1) {
        cout << 1 << endl;
    } else {
        int head = 0;
        int tail = N - 1;
        int cnt = 0;
        while (head <= tail) {
            // show(tail);
            // show(head);
            int len1 = 0;
            int hnext = 0;
            for (int i = tail; i >= head; i--) {
                int sum = 0;
                for (int j = 0; j < 26; j++) {
                    sum += ((int)bits[j].accumulate(i) - (int)((head > 0) ? bits[j].accumulate(head - 1) : 0) + 2) % 2;
                }
                if (sum == 1) {
                    hnext = i;
                    break;
                }
            }
            len1 = hnext - head + 1;
            int len2 = 0;
            int tnext = 0;
            for (int i = head; i <= tail; i++) {
                int sum = 0;
                for (int j = 0; j < 26; j++) {
                    sum += ((int)bits[j].accumulate(tail) - (int)((i > 0) ? bits[j].accumulate(i - 1) : 0) + 2) % 2;
                }
                if (sum == 1) {
                    tnext = i;
                    break;
                }
            }
            len2 = tail - tnext + 1;
            if (len1 < len2) {
                tail = tnext - 1;
            } else {
                head = hnext + 1;
            }
            cnt++;
        }
        cout << cnt << endl;
    }


    return 0;
}
