use std::io::{self, BufRead}; fn get_lines() -> Vec { let stdin = io::stdin(); let lines: Vec = stdin.lock().lines().map(|l| l.unwrap()).collect(); return lines; } fn main(){ let s = &get_lines()[0]; let l = s.len(); let mut i = 0; for c in s.chars().rev() { if c == 'c' { if l / 2 > i { println!("{}", i); } else { println!("{}", l - i - 1); } return; } i += 1; } }