#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b = "", c = "";
  cin >> a;
  int ans = 0;
  for (int i = 0; i <= a.size() - 1; i++) {
    c += a[i];
    if (b != c) {
      ans++;
      b = c;
      c = "";
    }
  }
  if (c != "") {
    ans++;
  }
  cout << ans;
  return 0;
}
