#include "bits/stdc++.h" using namespace std; // コンテスト中のみ //#define int long long #define ll long long #define rep(i,n) for(int i = 0; i < (n); i++) #define P pair #define ld long double ll INF = (1LL << 60); int MOD = 1000000007; signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N; cin >> N; vectorA(N), B(N); rep(i, N)cin >> A[i]; rep(i, N)cin >> B[i]; bool now = false; ll ans = 0; rep(i, N) { if (A[i] != B[i]) { now = true; } else { if (now) { ans++; now = false; } } }if (now) { ans++; now = false; } cout << ans << endl; return 0; }