#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector A(N), B(N); for (auto&& e : A) { cin >> e; } for (auto&& e : B) { cin >> e; } int res = 0; bool cur = A[0] == B[0]; for (int i = 0; i < N; i++) { if (cur ^ (A[i] == B[i])) { if (!cur) res++; cur = A[i] == B[i]; } } if (!cur) res++; cout << res << '\n'; return 0; }