#![allow(unused_imports)]

use std::{i32, i64, u32, u64, usize, f64};
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::io::{stdout, Write, BufWriter};
use std::mem::{swap};
use maplit::*;
use proconio::marker::{Isize1, Usize1, Bytes, Chars};

#[proconio::fastout]
fn main() {
    proconio::input!{
        s: Chars,
    }
    let n = s.len();
    let mut i = 1usize;
    let mut k = 1;
    let mut skip = false;
    while i < n {
        if s[i - 1] == s[i] {
            if n == 2 || (i == n - 1 && !skip) { break; }
            i += 2;
            skip = true;
        }
        else {
            i += 1;
            skip = false;
        }
        k += 1;
    }
    println!("{}", k);
}
