#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int inf = 1e9;
const long long INF = 1LL << 60;
int main() {
  string s;
  cin >> s;
  int k = 0;
  bool pre_two = false;
  for (int i = 0; i < s.size() - 1; i++) {
    if (i == 0 || pre_two || s[i] != s[i + 1]) {
      k++;
      pre_two = false;
    } else {
      k++;
      i++;
      pre_two = true;
    }
  }
  cout << k << endl;
}
