import core.bitop;
import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.format;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int[int] memo;
string str;
int dfs(int depth)
{
  if (depth == str.length) {
    return 0;
  }
  if (depth in memo) {
    return memo[depth];
  }
  int ans = int.max;
  uint bits = 0;
  for (int i = depth; i < str.length; ++i) {
    bits ^= 1U << (str[i] - 'a');
    if (popcnt(bits) <= 1) {
      int ret = 1 + dfs(i + 1);
      ans = min(ans, ret);
    }
  }
  return memo[depth] = ans;
}
void main()
{
  str = readln.chomp;
  writeln = 0.dfs;
}
