#include #include #include #include #include #include #include #include #include #include #include #define rep(i,n) for(int (i) = 0; i < (n); i++) using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; //const ll mod = 1e9 + 7; const ll mod = 998244353; const int inf = 123456; int main(){ int n; cin >> n; vector a(n) , b(n); rep(i,n)cin >> a[i]; rep(i,n)cin >> b[i]; int ans = 0; int cnt = 0; rep(i,n){ if(a[i] != b[i])cnt += 1; if(cnt > 0 && a[i] == b[i]){ ans += 1; cnt = 0; } } if(cnt > 0)ans += 1; cout << ans << endl; return 0; }