#include <bits/stdc++.h>
using namespace std;
const int n = 2 * 1e5;
int a[n];
int main() {
  string s;
  cin >> s;
  int e = 1;
  a[0] = 1;
  for (int i = 1; i < s.size(); i++) {
    int x = 1;
    if (s[i] == s[i - 1] && a[x - 1] == 2) {
      e++;
      a[x] = 1;
    } else {
      if (a[x - 1] == 1 && s[i] == s[i - 1]) {
        e++;
        i++;
        a[x] = 2;
      }
      if (a[x - 1] != 1 && s[i]) {
        e++;
        a[x] = 1;
      }
    }
    x++;
  }
  cout << e;
}
