#include <bits/stdc++.h>
long long mod = 1000000007;
using namespace std;
int main(void) {
  char s[100010];
  scanf("%s", s);
  int a = 0;
  int count = 0, i = 0;
  while (true) {
    if (s[i] == s[i + 1]) {
      i++;
      a++;
      if (a == 2) {
        a = 0;
        if (s[i] == s[i + 1]) {
          count++;
        }
      }
    }
    count++;
    if (s[i] == '\0' || s[i + 1] == '\0') {
      break;
    }
    i++;
  }
  printf("%d", count);
  return 0;
}
