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