use whiteread::parse_line;

fn main() {
    let s: String = parse_line().unwrap();
    let s: Vec<char> = s.chars().collect();
    let mut k = 0;

    for i in 0..s.len() - 1 {
        if s[i] != s[i + 1] {
            k += 1;
        }
    }
    println!("{}", k + 2);
}
