fn g() -> Vec { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.split_whitespace().flat_map(str::parse).collect() } fn main() { let n: usize = g()[0] + 1; g(); let a = g(); g(); let b = g(); let mut h = vec![false; n]; let mut c = 0; for a in a { c += a; h[c] = true; } for b in b { c -= b; h[c] = true; } println!("{}", h.iter().filter(|&&x| !x).count()); }