#include <bits/stdc++.h>
using namespace std;
int main() {
  freopen("inputf.in", "r", stdin);
  freopen("outputf.in", "w", stdout);
  string s;
  cin >> s;
  int n, i, j;
  int ans = 1, flag = 1;
  for (i = 1; i < s.length(); ++i) {
    if (flag == 0) {
      ++ans;
      flag = 1;
      continue;
    }
    if (s[i] != s[i - 1]) {
      flag = 1;
      ++ans;
      continue;
    }
    if ((i + 1) < s.length()) {
      ++ans;
      i = i + 1;
      flag = 0;
    }
  }
  cout << ans << endl;
}
