#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:10240000")
using namespace std;
const int MAXN = 100010;
char str[MAXN];
int w[MAXN], tot[MAXN][30], v[MAXN][30], ans[MAXN];
int finds(int k) {
  int now = w[k];
  if (now == -1) {
    return 1;
  } else {
    int cnt = 0;
    while (1) {
      int y = now;
      for (int j = 0; j < 26; j++) {
        int tmp = tot[now + 1][j] - tot[k][j];
        if (tmp % 2 == 1) {
          int x = w[v[now + 1][j]];
          if (x == -1) {
            cnt++;
          } else {
            y = max(x, y);
          }
        }
      }
      if (cnt >= 2) {
        break;
      } else if (y == now) {
        return now - k + 1;
      }
      now = y;
    }
    return 1;
  }
}
int main() {
  scanf("%s", &str);
  int len = strlen(str);
  memset(v, -1, sizeof(v));
  memset(tot, 0, sizeof(tot));
  for (int i = 0; i < len; i++) {
    for (int j = 0; j < 26; j++) {
      tot[i + 1][j] = tot[i][j];
      v[i + 1][j] = v[i][j];
    }
    tot[i + 1][str[i] - 'a']++;
    v[i + 1][str[i] - 'a'] = i;
  }
  memset(w, -1, sizeof(w));
  for (int j = 0; j < 26; j++) {
    int last = -1;
    for (int i = len - 1; i >= 0; i--) {
      if (str[i] - 'a' == j) {
        w[i] = last;
        last = i;
      }
    }
  }
  memset(ans, 0, sizeof(ans));
  for (int i = len - 1; i >= 0; i--) {
    int tmp = finds(i);
    int now = ans[i + tmp];
    if (tmp % 2 == 1) {
      now++;
    }
    ans[i] = min(1 + ans[i + 1], now);
  }
  if (!ans[0]) {
    ans[0] = 1;
  }
  printf("%d\n", ans[0]);
  return 0;
}
