#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string str;
  cin >> str;
  int len = str.size();
  int count = 1;
  string x = "", y = "";
  x += str[0];
  for (int i = 1; i < len; i++) {
    y = "";
    y += str[i];
    if (x == y) {
      if ((i + 1) < len) {
        y += str[i + 1];
        i++;
        count++;
      }
    } else {
      count++;
    }
    x = y;
  }
  cout << count;
  return 0;
}
