use strict;
use warnings;

my(@in) = split(//,<>);
my $cnt = 0;
my ($prev, $now) = ('', '');

for my $i (0 ... $#in){
	$now .= $in[$i];
	if($prev ne $now){
		$cnt++;
		$prev = $now;
		$now = '';
	}
}
print "$cnt\n";
