import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] ch = sc.next().toCharArray();
		sc.close();
		int cnt = 0;
		for(int i = 0;i < ch.length-1;i++){
			if(ch[i]==ch[i+1]){
				i++;
			}
			cnt++;
		}
		System.out.println(ch[ch.length-1]==ch[ch.length-2] ? cnt+1 : cnt);
	}
}