#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
struct score {
  long long sum;
  vector<long long> minusV;
};
int main() {
  string s;
  cin >> s;
  const char* schar;
  schar = s.c_str();
  int k = 1;
  for (int i = 1; i < s.length(); i++) {
    if (schar[i - 1] != schar[i]) {
      k++;
    } else {
      if (i == s.length() - 1) {
        break;
      } else {
        i += 2;
        k += 2;
      }
    }
  }
  cout << k << endl;
}
