#include <bits/stdc++.h>
using namespace std;
string s;
int n[200001];
int m = 52;
int countbits(int x) {
  int r = 0;
  while (x) {
    x &= x - 1;
    r++;
  }
  return r;
}
void f(int r, int l, int c) {
  if (l > s.length()) {
    return;
  }
  if (c + 1 >= m) {
    return;
  }
  f(r, l + 1, c);
  if (countbits(n[l] ^ n[r]) <= 1) {
    if (l == s.length()) {
      m = min(m, c + 1);
      return;
    }
    f(l, l + 1, c + 1);
  }
}
int main() {
  cin >> s;
  n[0] = 0;
  for (int i = 0; i < s.length(); i++) {
    n[i + 1] = n[i] ^ 1 << (s[i] - 'a');
  }
  f(0, 1, 0);
  cout << m << endl;
  return 0;
}
