func main() var n: int :: cui@inputInt() var a: []int :: #[n]int for i(0, n - 1) do a[i] :: cui@inputInt() end for for i(0, n - 1) var b: int :: cui@inputInt() if(b = 0) do a[i] :: 1 - a[i] end if end for var ans: int :: 0 for i(0, n - 1) if(a[i] = 0) do ans :+ 1 while(i <> n & a[i] = 0) do i :+ 1 end while end if end for do cui@print("\{ans}\n") end func