#include <bits/stdc++.h>
using namespace std;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long LINF = numeric_limits<long long>::max() / 3;
struct Double {
  double d;
  explicit Double(double x) : d(x) {}
};
ostream& operator<<(ostream& os, const Double x) {
  os << fixed << setprecision(20) << x.d;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
  os << "[";
  for (const auto& v : vec) {
    os << v << ",";
  }
  os << "]";
  return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& st) {
  os << "{";
  for (T v : st) os << v << ",";
  os << "}";
  return os;
}
template <typename T, typename U>
inline void chmax(T& x, U y) {
  if (y > x) x = y;
}
template <typename T, typename U>
inline void chmin(T& x, U y) {
  if (y < x) x = y;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
constexpr double eps = 1e-10;
constexpr long long mod = 1e9 + 7;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
int f(string s) {
  int n = s.size();
  vector<vector<int> > cnt(26, vector<int>(n + 1, 0));
  for (int i = 0; i < n; i++) {
    char c = s[i] - 'a';
    for (int j = 0; j < 26; j++) {
      if (j != c) {
        cnt[j][i + 1] = cnt[j][i];
      } else {
        cnt[j][i + 1] = cnt[j][i] + 1;
      }
    }
  }
  int ans = 0;
  int l = 0;
  while (l < n) {
    bool f = false;
    for (int i = n; i > 0; i--) {
      if (i == l) break;
      int o = 0, e = 0;
      for (int j = 0; j < 26; j++) {
        int t = cnt[j][i] - cnt[j][l];
        if (t == 0) continue;
        if (t % 2 == 0)
          e++;
        else
          o++;
      }
      if (o <= 1) {
        l = i;
        f = true;
        break;
      }
    }
    if (!f) {
      l++;
    }
    ans++;
  }
  return ans;
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int ans1 = f(s);
  int ans2 = f(s.substr(0, n / 2)) + f(s.substr(n / 2));
  reverse((s).begin(), (s).end());
  int ans3 = f(s);
  int ans4 = f(s.substr(0, n / 2)) + f(s.substr(n / 2));
  cout << max({ans1, ans2, ans3, ans4}) << endl;
}
