#include #ifndef DUMP #define DUMP(...) (void)0 #endif using namespace std; template auto rle(const S& s) { vector> res; for (auto c : s) if (empty(res) or res.back().first != c) res.emplace_back(c, 1); else ++res.back().second; return res; } int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; cin >> n; vector a(n), b(n), c(n); for (auto&& e : a) cin >> e; for (auto&& e : b) cin >> e; for (int i = 0; i < n; ++i) c[i] = a[i] != b[i]; int res = 0; for (auto [x, y] : rle(c)) if (x) ++res; cout << res << '\n'; }