#![allow(non_snake_case)]
#![allow(unused_imports)]

use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;
use num::*;
use num_traits::*;
use superslice::*;
use std::ops::*;

use itertools::Itertools;
use itertools_num::ItertoolsNum;

#[fastout]
fn main() {
    input!{
        s: String,
    }
    let mut tmp_vec: Vec<char> = vec![];
    let mut ans = 0;
    for (i, c) in s.chars().enumerate() {
        if i == 0 {
            tmp_vec.push(c);
            ans += 1;
            continue;
        }

        if tmp_vec == vec![c] {
            tmp_vec.push(c);
            if i == s.len() - 1 {
                ans += 1;
            }
        } else {
            tmp_vec = vec![c];
            ans += 1;
        }
    }
    println!("{}", ans);
}
