#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  bool flag = false;
  int ans = 0;
  char now;
  for (int i = 0; i < S.length(); i++) {
    if (flag == false) {
      ans++;
      flag = true;
      now = S[i];
    } else if (now != S[i]) {
      now = S[i];
      ans++;
    } else {
      flag = false;
      if (i == S.length() - 1) {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
