#include #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; int main() { int N; cin >> N; vector A(N), B(N); rep(i, N) cin >> A[i]; rep(i, N) cin >> B[i]; int c = 1; rep(i, N - 1) { if ((A[i] ^ B[i]) != (A[i + 1] ^ B[i + 1])) c++; } cout << (c + 1) / 2 << "\n"; }