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