#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int i;
  cin >> S;
  int a = S.size();
  int ans = 1;
  int left = 0;
  while (left < a - 1) {
    int flag[26];
    for (i = 0; i < 26; i++) flag[i] = 1;
    for (i = left; i < a; i++) flag[S[i] - 'a'] *= -1;
    int k = a - 1;
    int p = 0;
    for (i = 0; i < 26; i++) p += (flag[i] == -1);
    if (p >= 2) {
      ans += 1;
    }
    while (p >= 2) {
      if (flag[S[k] - 'a'] == -1) {
        flag[S[k] - 'a'] = 1;
        p -= 1;
      } else {
        flag[S[k] - 'a'] = -1;
        p += 1;
      }
      k -= 1;
    }
    left = k + 1;
  }
  cout << ans << endl;
  return 0;
}
