#include /** * @title Run length encoding * @docs run_length_encoding.md */ template auto run_length_encoding(const Container &v){ std::vector> ret; for(auto &x : v){ if(ret.empty()) ret.emplace_back(x, 1); else if(ret.back().first == x) ++ret.back().second; else ret.emplace_back(x, 1); } return ret; } namespace solver{ void solve(){ std::cin.tie(0); std::ios::sync_with_stdio(false); int N; std::cin >> N; std::vector A(N), B(N); for(int i = 0; i < N; ++i) std::cin >> A[i]; for(int i = 0; i < N; ++i) std::cin >> B[i]; for(int i = 0; i < N; ++i){ A[i] = A[i] ^ B[i]; } auto r = run_length_encoding(A); int ans = 0; for(auto [x, i] : r){ if(x == 1) ++ans; } std::cout << ans << "\n"; } } int main(){ solver::solve(); return 0; }