#include #include #include template std::vector> runlength( It begin, It end) { using T = typename It::value_type; std::vector> res; while (begin != end) { const T& c = *(begin++); if (res.empty() || c != res.back().first) { res.emplace_back(c, 1); } else { ++res.back().second; } } return res; } void solve() { int n; std::cin >> n; std::vector xs(n); for (auto& x : xs) std::cin >> x; for (auto& x : xs) { int y; std::cin >> y; x ^= y; } auto ps = runlength(xs.begin(), xs.end()); int ans = 0; for (auto [c, l] : ps) ans += c; std::cout << ans << "\n"; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }