#include <stdio.h>

int r, c, p;

int main() {
  while((c = getchar_unlocked()) != '\n') {
    if (c == p) {
      p = 1;
    }
    else {
      r += 1;
      p = c == 1 ? 0 : c;
  }
  printf("%d\n", r);
}
