#include #include #include #include #include #include #include #include #include using namespace std; #pragma warning (disable: 4996) int N, A[1 << 18], B[1 << 18]; int cnt = 0; int main() { cin >> N; for (int i = 1; i <= N; i++) cin >> A[i]; for (int i = 1; i <= N; i++) cin >> B[i]; for (int i = 1; i <= N; i++) B[i] ^= A[i]; for (int i = 1; i <= N; i++) { if (B[i] == 1 && B[i - 1] == 0) cnt++; } cout << cnt << endl; return 0; }