#include <bits/stdc++.h>
const int INF = 1 << 25;
const long long MOD = 1000000007LL;
using namespace std;
bool odd[200001][26];
int dp[200001];
int len[200001][2];
int hoge[200001];
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    for (int j = 0; j < 26; j++) odd[i + 1][j] = odd[i][j];
    odd[i + 1][s[i] - 'a'] ^= 1;
  }
  fill((int*)dp, (int*)(dp + 200001), 1 << 30);
  dp[0] = 0;
  dp[1] = 1;
  for (int i = 2; i <= s.size(); i++) {
    for (int j = i; j >= 1; j--) {
      int sum = 0;
      for (int k = 0; k < 26; k++) {
        if (odd[i][k] ^ odd[i - j][k]) sum++;
      }
      if (sum <= 1) {
        dp[i] = dp[i - j] + 1;
        break;
      }
    }
  }
  cout << dp[s.size()] << endl;
}
