#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  vector<string> s(200000);
  int r = 1;
  int i = 0;
  s[0] = S.at(0);
  while (true) {
    if (s[i].size() > 1 || s[i].at(0) != S.at(r)) {
      s[i + 1] = S.at(r);
      r++;
    } else if (r == S.size() - 1) {
      s[i + 1] = S.at(r);
      r++;
    } else {
      s[i + 1] = S.at(r) + S.at(r + 1);
      r += 2;
    }
    i++;
    if (r >= S.size() - 1) break;
  }
  int K = i + 1;
  if (s[i] == s[i + 1]) K--;
  cout << K << endl;
}
