#include using namespace std; using ll=long long; using vi = vector; using vvi = vector>; using vl = vector; using vvl = vector>; #define all(x) x.begin(),x.end() #define rep(i,j,n) for (long long i = j; i < (long long)(n); i++) #define _GLIBCXX_DEBUG const ll MOD = 1000000007; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } //(a+b-1)/b //priority_queue, greater> q; signed main(){ //cout << fixed << setprecision(10); ll n; cin >> n; vl a(n),b(n); rep(i,0,n)cin >>a[i]; rep(i,0,n)cin >> b[i]; ll ans = 0, cnt = 0; rep(i,0,n){ if(a[i] != b[i])cnt++; else{ ans += (cnt != 0); cnt = 0; } } ans += (cnt != 0); cout << ans << endl; return 0; }