local n = io.read("*n", "*l") local a = {} local b = {} s = io.read() for v in s:gmatch("%d") do table.insert(a, tonumber(v)) end s = io.read() for v in s:gmatch("%d") do table.insert(b, tonumber(v)) 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)