#![allow(unused_imports)] fn main() { input! { s: Chars } println!("{}", s.windows(3).filter(|s| (s[0] == s[1]) ^ (s[1] == s[2])).count()); } use proconio::{input, marker::*}; use itertools::{iproduct, izip, Itertools as _}; use std::{cmp::Reverse, collections::*}; #[macro_export] macro_rules! chmax { ($a:expr, $b:expr) => {{ let tmp = $b; if $a < tmp { $a = tmp; true } else { false } }}; } #[macro_export] macro_rules! chmin { ($a:expr, $b:expr) => {{ let tmp = $b; if $a > tmp { $a = tmp; true } else { false } }}; } #[macro_export] /// mvec![] macro_rules! mvec { ($val:expr; ()) => { $val }; ($val:expr; ($size:expr $(,$rest:expr)*)) => { vec![mvec![$val; ($($rest),*)]; $size] }; }