use proconio::input; use proconio::marker::Bytes; fn main() { input! { s: Bytes, } let mut start = 0; let mut ans = 0_usize; for (i, &c) in s.iter().enumerate() { if c == b'0' { let next = start + (start + i) % 2; ans += (i - next) / 2; start = next + 1; } } println!("{ans}"); }