fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let mut n: usize = n.trim().parse().unwrap(); let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let itr = s.trim().split_whitespace(); let a: Vec = itr.map(|x| x.parse().unwrap()).collect(); let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let itr = s.trim().split_whitespace(); let b: Vec = itr.map(|x| x.parse().unwrap()).collect(); let mut ans = 0; if a[0] ^ b[0] == 1 { ans += 1; } for i in 1..n{ if a[i] != b[i] && a[i - 1] == b[i - 1] { ans += 1; } } println!("{}", ans); }