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