#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = int(s.size());
  int ans = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (i == 0) {
      ans++;
      continue;
    }
    if (s[i] != s[i - 1]) {
      ans++;
      continue;
    } else {
      i++;
      ans++;
    }
  }
  cout << ans << endl;
}
