#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, F = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') F = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * F;
}
char s[100000 + 5];
int n, ans, cnt, flag;
char pre;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  int i;
  pre = '0';
  for (i = 1; i <= n; i++)
    if (s[i] == pre) {
      pre = '0';
      flag = 1;
    } else {
      if (!flag) pre = s[i];
      flag = 0;
      ans++;
    }
  printf("%d", ans);
}
