#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0;
  string s;
  cin >> s;
  n = int(s.size());
  for (int i = 0; i < (n - 1); ++i) {
    if (s[i] == s[i + 1]) {
      if (i != n - 2) {
        i += 2;
        count += 2;
      }
    } else {
      count++;
    }
  }
  cout << count + 1 << endl;
  return 0;
}
