#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();
  s += "p";
  string hold = "p";
  int ans = 0;
  int ref = 1;
  while (ref < n) {
    string show = "";
    show += s[ref];
    if (show != hold) {
      ++ans;
      hold = s[ref];
      ++ref;
    } else {
      ++ans;
      hold = s[ref] + s[ref + 1];
      ref += 2;
    }
  }
  cout << ans << endl;
}
