#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int N; cin >> N; vector A(N), B(N); rep(i,N) cin >> A[i]; rep(i,N) cin >> B[i]; vector C(N); rep(i,N) C[i] = (A[i] == B[i]); vector> v; v.push_back({C[0], 1}); for(int i = 1; i < N; i++) { if(v.back().first == C[i]) { v.back().second++; } else { v.push_back({C[i], 1}); } } int ans = 0; for(auto [x, c] : v) if(x == 0) ans++; cout << ans << endl; }