function Main(input) {
	input = input.split("\n");
	tmp = input[0].split("");
	var dev_tmp = new Array();
	var i=1;
	var j=1;
	dev_tmp[0] = tmp[0];
  while(i<=tmp.length){
    dev_tmp[j] = tmp[i];
    if(dev_tmp[j-1] === dev_tmp[j]){
       if(tmp[i+1] === undefined){
          tmp[i+1] = "";
          dev_tmp[j] = tmp[i]+tmp[i+1];
          break;
       }
       dev_tmp[j] = tmp[i]+tmp[i+1];
       i = i+2;
    }else{       
      dev_tmp[j] = tmp[i];
      i++;
    }
    j++;
  }
  dev_tmp.pop();
  console.log(dev_tmp.length);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));