#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int k = 0, j = 0;
  for (int i = 0; i < s.size(); i++) {
    i = j;
    if (s[i] == s[i + 1]) {
      k++;
      j += 2;
    } else {
      k++;
      j++;
    }
  }
  cout << k;
}
