$str = <STDIN>;
chomp($str);
@chars = split(//, $str);
$len = @chars;
$sum = 0;


for (my $i=0; $i<$len-1; $i++) {
    if ($skip == 1) {
        $skip = 0;
        next;
    }
    
    if ($chars[$i] eq $chars[$i+1]) {
        $skip = 1;
        $sum++;
        next;
    } else {
        $sum++;
    }
}
$sum++;

print $sum;