#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
string s;
int main() {
  cin >> s;
  ll n = s.size();
  s = s + "$";
  string prev = s.substr(0, 1);
  ll k = 1;
  for (int i = 1; i < n; i++) {
    if (prev == s.substr(i, 1)) {
      prev = s.substr(i, 2);
      i++;
    } else {
      prev = s.substr(i, 1);
    }
    k++;
  }
  if (prev.size() == 2) k--;
  cout << k << endl;
}
