import java.util.Scanner import scala.collection.mutable.ArrayBuffer object Main extends App { val sc = new Scanner(System.in) val n = sc.nextInt val al = ArrayBuffer.fill(n)(sc.nextInt) val bl = ArrayBuffer.fill(n)(sc.nextInt) var ans = 0 var f = al(0) != bl(0) for(i <- 0 until n) { val c = al(i) != bl(i) if(c) { if(f) { ans += 1 f = false } } else { f = true } } println(ans) }