#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long mod1 = 1e6;
long long pwr(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}
const long long N = 1e5 + 5;
long long get_val(string s) {
  if ((long long)s.size() == 1)
    return s[0] - 'a' + 1;
  else
    return (s[0] - 'a' + 1) + 26 * (s[1] - 'a' + 1);
}
long long dp[N][705];
signed main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  long long n = (long long)s.size();
  s = '0' + s;
  for (long long i = 0; i <= n - 1; i++) {
    for (long long j = 0; j <= 702; j++) {
      long long val = get_val(s.substr(i + 1, 1));
      if (val != j) {
        dp[i + 1][val] = max(dp[i + 1][val], dp[i][j] + 1);
      }
      if (i < n - 2) {
        val = get_val(s.substr(i + 1, 2));
        dp[i + 2][val] = max(dp[i + 2][val], dp[i][j] + 1);
      }
    }
  }
  long long ans = 0;
  for (long long i = 0; i <= 702; i++) {
    ans = max(ans, dp[n][i]);
  }
  cout << ans;
  return 0;
}
