#include <bits/stdc++.h>
using namespace std;
string a, last;
int ans;
int main() {
  cin >> a;
  last.push_back(a[0]);
  ans++;
  for (int i = 1; i < (int)a.size();) {
    if (a.substr(i, 1) == last)
      last = a.substr(i, 2), i += 2;
    else
      last = a.substr(i, 1), i++;
    ans++;
  }
  printf("%d\n", ans);
}
