local n = io.read("*n") local a = {} local b = {} for i = 1, n do a[i] = io.read("*n") end for i = 1, n do b[i] = io.read("*n") end local t = {0} for i = 1, n do if a[i] == b[i] then table.insert(t, i) end end table.insert(t, n + 1) c = 0 for i = 1, #t - 1 do if 1 < t[i + 1] - t[i] then c = c + 1 end end print(c)