#include <bits/stdc++.h>
using namespace std;
int main() {
  string ss;
  cin >> ss;
  int sum = 0;
  if (ss.length() == 1)
    cout << 1 << endl;
  else {
    if (ss[ss.length() - 1] == ss[ss.length() - 2])
      sum = 1;
    else
      sum = 2;
  }
  for (int i = 0; i < ss.length() - 2; i++)
    if (ss[i] != ss[i + 1]) {
      sum++;
    } else if (i + 2 < ss.length() - 1) {
      sum += 2;
      i += 2;
    } else {
      sum++;
    }
  cout << sum << endl;
  return 0;
}
