#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  char l = '$';
  bool fl = false;
  int i = 0;
  while (i < s.size()) {
    if (i && s[i - 1] == s[i] && !fl) {
      i += 2;
      fl = true;
    } else {
      i++;
      fl = false;
    }
    ans++;
  }
  cout << ans;
}
