#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  bool x = 0;
  int sum = s.size();
  for (int i = 1; i < s.size(); i++) {
    if (x) x = !x;
    if (s[i] == s[i - 1]) {
      i++;
      sum--;
      x = 1;
    }
  }
  cout << sum << '\n';
}
