use std::io::Read; fn solve(a: Vec) { let mut cnt: usize = 1; let mut continuing: bool = true; let mut prev: usize = a[0]; a.iter().skip(1).for_each(|i| { if prev == *i || !continuing { cnt += 1; continuing = true } else { continuing = false } prev = *i; }); println!("{}", cnt); } fn main() { let mut all_data = String::new(); std::io::stdin().read_to_string(&mut all_data).ok(); let all_data: Vec<&str> = all_data.trim().split('\n').map(|a| a.trim()).collect(); let a: Vec = all_data.iter().skip(1).next().unwrap().split_whitespace().map(|i| i.parse::().unwrap()).collect(); solve(a); }