fn main() -> Result<(), std::io::Error> { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let input_str = s.trim(); let mut ans = -1; for (id, i) in input_str.chars().enumerate() { if id == 0 { if i != '1' { ans = -1; break } } else { if i == '3' { ans += 1; } else { ans = -1; break; } } } println!("{}", ans); Ok(()) }