local n = io.read("*n", "*l") local a = {} local b = {} s = io.read() for i = 1, n do a[i] = s:byte(i * 2 - 1) end s = io.read() for i = 1, n do b[i] = s:byte(i * 2 - 1) 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)