#include <bits/stdc++.h>
using namespace std;
int main() {
  char c[200005];
  scanf("%s", &c);
  int sum = 1;
  string s1;
  string s2;
  s1 = c[0];
  for (int i = 1; i <= strlen(c); i++) {
    s2 += c[i];
    if (s1 != s2) {
      s1 = s2;
      sum++;
      s2.clear();
    }
  }
  cout << sum - 1 << endl;
  return 0;
}
