use std::io::stdin;

fn main() {
    let mut st = String::new();
    stdin().read_line(&mut st).unwrap();
    let s:Vec<char> = st.trim().chars().collect();
    let mut start:usize = 0;
    let mut end:usize = 1;
    let mut result: i64 = 0;
    for i in 1..(s.len()) {
        if s[start..end] == s[end..i] {
            continue;
        } else {
            start = end;
            end = i;
            result += 1;
        };
    };
    if s.len()==1{
        result += 1;
    };
    println!("{}", result);
}