#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int INF = 1e9;
const double EPS = 1e9;
const ll MOD = 1e9 + 7;
int main() {
  std::string S;
  std::cin >> S;
  int cnt = 1;
  bool f = false;
  for (int i = 1; i < S.size(); ++i) {
    if (S[i - 1] != S[i] || f) {
      cnt++;
      f = false;
    } else {
      i++;
      cnt++;
      f = true;
    }
  }
  if (f) cnt--;
  cout << cnt << endl;
  return 0;
}
