#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  string prev = {s[0]};
  for (int i = 1; i < s.size(); i++) {
    string curr = {s[i]};
    if (prev == curr) {
      n--;
      prev = curr + s[++i];
    } else {
      prev = curr;
    }
  }
  cout << n << endl;
}