use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn main () {
    let s: String = input();
    let s: Vec<char> = s.chars().collect();
    let mut i = 1;
    let mut count = 1;
    while i < s.len() {
        if s[i] == s[i-1] {
            i += 2;
        } else {
            i += 1;
        }
        count += 1;
    }
    println!("{}", count);
}