#include <bits/stdc++.h>
using namespace std;
int n, memo[200005];
unordered_map<int, int> freq;
string s;
bool check(int k, int sum = 0) {
  for (int i = 0; i < 26; sum += !!(k & (1 << i++))) {
  }
  return sum < 2;
}
int solve(int idx) {
  if (memo[idx] != -1) return memo[idx];
  if (idx >= s.size()) return memo[idx] = 0;
  int ans = 1e9;
  for (int i = idx; i < s.size(); ++i)
    if (check(freq[idx - 1] ^ freq[i])) {
      ans = min(ans, 1 + solve(i + 1));
    }
  return memo[idx] = ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q, m, k, h, ans = 0, sum = 0, p, x, y;
  cin >> s;
  freq[-1] = 0;
  for (int i = 0; i < s.size(); ++i) {
    freq[i] = freq[i - 1] ^ (1 << (s[i] - 'a'));
  }
  for (int i = 0; i < 200005; ++i) memo[i] = -1;
  cout << solve(0);
}
