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