#include <bits/stdc++.h>
using namespace std;
int main() {
  int k = 0, i = 0;
  string s, x, y;
  cin >> s;
  while (true) {
    if (s[i] == '\0') {
      break;
    }
    x = s[i];
    y = s[i + 1];
    if (x != y) {
      i++;
    } else {
      i += 2;
    }
    k++;
    if (y[0] == '\0') {
      break;
    }
  }
  cout << k << endl;
}
