#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int main() {
  string s;
  cin >> s;
  char key = 'A';
  int ans = 0;
  bool flag = false;
  for (int i = 0; i < s.size() - 1; i++) {
    if (i == s.size() - 2) {
      if (s[i] != s[i + 1]) ans++;
    } else {
      if (key == s[i]) flag = true;
      if (flag) {
        i++;
        ans++;
        key = 'A';
        flag = false;
      } else {
        key = s[i];
        ans++;
      }
    }
  }
  cout << ans + 1 << endl;
}
