function Main(input) {
  var output = 0;
  var list = [];
  var output = input.length;
  var tmp = "";
  for(var i = 0; i < input.length; i++){
    tmp += input.slice(i, i + 1);
    if(list.length == 0){
      list.push(tmp);
      tmp = "";
      continue;
    }else{
      var mae = list[list.length - 1];
      if(mae == tmp){
         continue;
      }else{
        list.push(tmp);
        tmp = "";
        continue;
      }
    }
  }
  console.log(list.length);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
