#include #define F first #define S second using namespace std; using ll = long long; typedef pair P; ll Mod = 1000000007; int main() { int N; cin >> N; int A[N],B[N]; int C[N]; for (int i = 0; i < N; i++) cin >> A[i]; for (int i = 0; i < N; i++) cin >> B[i]; int ans = 0; for (int i = 0; i < N; i++) { if (A[i] == B[i]) { C[i] = 0; } else { C[i] = 1; } } int st = 0; for (int i = 1; i < N; i++) { if (C[i-1] == 1 && C[i] == 0) { ans++; } } if (C[N-1] == 1) { ans++; } cout << ans << endl; return 0; }