N = gets.to_i A = gets.split.map(&:to_i) B = gets.split.map(&:to_i) flip = false ans = 0 A.zip(B) do |a, b| if a == b flip = false else if !flip flip = true ans += 1 end end end puts ans