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