#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

bool judge(string str){
	int alpha[26];
	// 初期化
	for (size_t i = 0; i < 26; i++) {
		alpha[i] = 0;
	}

	for (size_t i = 0; i < str.size(); i++) {
		alpha[str[i]-'a']++;
		alpha[str[i]-'a'] %= 2;
	}

	int flag = false;
	for (size_t i = 0; i < 26; i++) {
		if (alpha[i] != 0) {
			if (flag) {
				return false;
			}
			else {
				flag = true;
			}
		}
	}
	return true;
}

int tansaku(string str, int count){
	string sub(str);
	std::vector<int> v;
	for (size_t i = 0; i < str.size(); i++) {
		if (judge(sub)) {
			string next(str);
			v.push_back(tansaku(next.erase(next.begin(), next.begin()+sub.size()) , count++));
		}
		sub.pop_back();
	}
	int ans = v[0];
	for (size_t i = 0; i < v.size(); i++) {
		ans = min(ans, v[i]);
	}
	return ans;
}

int main(int argc, char const *argv[]) {
	string str;
	std::cin >> str;
	std::cout << tansaku(str,1) << '\n';
	return 0;
}
