#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  int l;
  int i = 0;
  int count = 0;
  cin >> str;
  l = (int)(str.length());
  while (i < l) {
    if (str[i] == str[i + 1]) {
      i += 3;
      count += 2;
    } else {
      i++;
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
