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