#include <bits/stdc++.h>
using namespace std;
template <typename Tn>
Tn __lcm(Tn a, Tn b) {
  return a / __gcd(a, b) * b;
}
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  string s;
  cin >> s;
  int ans = 0;
  string str = "" + s[0];
  for (int i = 1; i < s.size() - 1; i++) {
    if (str == "" + s[i]) {
      str = "" + s[i] + s[i + 1];
      i++;
    } else {
      str = "" + s[i];
    }
    ans++;
  }
  if (s.size() > 1) {
    if (s[s.size() - 1] != s[s.size() - 2]) ans++;
  }
  cout << ans + 1 << endl;
  return 0;
}
