#include <bits/stdc++.h>
using namespace std;
long long fac[2000009], not_prime[2000009], ar[2000009];
long long power(long long x, long long n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return power((x * x), n / 2);
  else
    return (x * power((x * x), (n - 1) / 2));
}
void fact() {
  fac[0] = 1;
  for (long long i = 1; i < 21; i++) fac[i] = (i * fac[i - 1]);
}
void sieve() {
  not_prime[1] = 1;
  not_prime[0] = 1;
  for (long long p = 2; p * p < 2000009; p++) {
    if (!not_prime[p]) {
      for (long long i = p * 2; i <= 2000009; i += p) not_prime[i] = 1;
    }
  }
}
long long modi(long long a, long long m) {
  long long m0 = m, t, q;
  long long x0 = 0, x1 = 1;
  if (m == 1) return 0;
  while (a > 1) {
    q = a / m;
    t = m;
    m = a % m, a = t;
    t = x0;
    x0 = x1 - q * x0;
    x1 = t;
  }
  if (x1 < 0) x1 += m0;
  return x1;
}
long long nos[500009], nor[500009], con[27];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  long long i, j, k, test, flag, ans, n, p, m, t, a, b, c;
  string s1;
  test = 1;
  while (test--) {
    cin >> s1;
    nos[0] = 1;
    for (i = 0; i < s1.size(); i++) {
      con[s1[i] - 97]++;
      if (i) {
        if (con[s1[i] - 97] & 1)
          nos[i] = 1 + nos[i - 1];
        else
          nos[i] = nos[i - 1] - 1;
      }
    }
    nor[s1.size() - 1] = 1;
    memset(con, 0, sizeof(con));
    for (i = s1.size() - 1; i >= 0; i--) {
      con[s1[i] - 97]++;
      if (i != s1.size() - 1) {
        if (con[s1[i] - 97] & 1)
          nor[i] = 1 + nor[i + 1];
        else
          nor[i] = nor[i + 1] - 1;
      }
    }
    ans = 1e9;
    for (j = 0; j < s1.size(); j++) {
      ans = min(ans, max(nos[j], 1LL) +
                         ((j + 1 == s1.size()) ? 0 : max(nor[j + 1], 1LL)));
    }
    cout << ans;
  }
  return 0;
}
