#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<string> s_split;
  int i = 0;
  int j = 1;
  int k = 1;
  reverse(s.begin(), s.end());
  s_split.push_back(s.substr(0, 1));
  while (k < s.size()) {
    if (s_split[i] != s.substr(i + j, 1)) {
      s_split.push_back(s.substr(i + j, 1));
      j = 1;
      k++;
    } else {
      s_split.push_back(s.substr(i + j, 2));
      j = 2;
      k += 2;
    }
    i++;
  }
  cout << s_split.size() << endl;
}
