#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
const ll MOD = 1e9 + 7, N = 1e5 + 10;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  ll n = s.length();
  string res = "", prv = "" + s[0];
  ll ans = 0;
  for (ll i = 1; i < n; i++) {
    res += s[i];
    if (res != prv) {
      ans++;
      prv = res;
      res = "";
    }
  }
  cout << ans << '\n';
  return 0;
}
