#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  string s;
  cin >> s;
  int n;
  n = s.length();
  string hold = "p";
  int ans = 0;
  int ref = 0;
  while (ref < n) {
    string show = "";
    show += s[ref];
    if (show != hold) {
      ++ans;
      hold = s[ref];
      ++ref;
    } else {
      if (ref + 1 > n - 1)
        ref += 2;
      else {
        ++ans;
        hold = "";
        hold += s[ref];
        hold += s[ref + 1];
        ref += 2;
      }
    }
  }
  cout << ans << endl;
}
