#include <bits/stdc++.h>
using namespace std;
char s[2000005];
int main() {
  cin >> s;
  int cnt = 1;
  int len = 1;
  int n = strlen(s);
  for (int i = 1; i < n; i++) {
    if (len != 2 && s[i] == s[i - 1]) {
      cnt++;
      i++;
    } else {
      cnt++;
      len = 1;
    }
  }
  cout << cnt << endl;
  return 0;
}
