#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
bool cmin(A &a, const B &b) {
  return a > b ? (a = b, true) : false;
}
template <typename A, typename B>
bool cmax(A &a, const B &b) {
  return a < b ? (a = b, true) : false;
}
const double PI = acos(-1);
const double EPS = 1e-7;
int inf = sizeof(int) == sizeof(long long) ? 9e18 : 1e9;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int out = n;
  vector<vector<int> > in(n + 1, vector<int>(26));
  for (int i = 0; i < n; i++) {
    in[i + 1] = in[i];
    in[i + 1][s[i] - 'a']++;
  }
  for (int q = 0; q < n; q++) {
    int co1 = 0, co2 = 0;
    for (int i = 0; i < 26; i++) {
      int t = in[q][i];
      if (t % 2) co1++;
      t = in[n][i] - t;
      if (t % 2) co2++;
    }
    if (!co1) co1++;
    if (!co2) co2++;
    out = min(out, co1 + co2);
  }
  cout << out << endl;
}
