use std::io; use std::io::Read; const L: u8 = '^' as u8; const R: u8 = '*' as u8; fn main() { let (mut l, mut r) = (0, 0); for (i, b) in io::stdin().bytes().enumerate() { if i % 5 == 1 { match b { Ok(L) => l += 1, Ok(R) => r += 1, _ => (), } } } println!("{} {}", l, r); }