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