#include <bits/stdc++.h>
using namespace std;
const int MX = 100005, INF = 1001001001;
const long long int LINF = 1e18;
const double eps = 1e-10;
const int DIV = 1e9 + 7;
string s;
map<char, vector<int> > mp;
int main() {
  cin >> s;
  int n = s.size();
  for (int c = 0; c < (26); ++c) {
    vector<int> a(n, 0);
    mp[(char)('a' + c)] = a;
  }
  for (int i = (n)-1; i >= 0; --i) {
    for (int c = 0; c < (26); ++c) {
      if (i == n - 1) {
        if (s[i] == (char)('a' + c)) {
          mp[(char)('a' + c)][i] = 1;
        } else {
          mp[(char)('a' + c)][i] = 0;
        }
      } else {
        if (s[i] == (char)('a' + c)) {
          mp[(char)('a' + c)][i] = mp[(char)('a' + c)][i + 1] + 1;
        } else {
          mp[(char)('a' + c)][i] = mp[(char)('a' + c)][i + 1];
        }
      }
    }
  }
  int las = n - 1;
  int ans = 0;
  map<char, int> ima;
  for (int c = 0; c < (26); ++c) {
    ima[(char)('a' + c)] = 0;
  }
  while (las != 0) {
    int cand = las;
    for (int i = las; i >= 0; i--) {
      int kisu = 0;
      for (auto it = mp.begin(); it != mp.end(); it++) {
        if ((it->second[i] - ima[it->first]) % 2 == 1) kisu++;
      }
      if (kisu < 2) cand = i;
    }
    las = cand;
    ans++;
    for (int c = 0; c < (26); ++c) {
      ima[(char)('a' + c)] = mp[(char)('a' + c)][las];
    }
  }
  cout << ans << endl;
}
