#include #define rep(i,n) for(int i=0;i<(int)(n);i++) using namespace std; using ll = long long ; using P = pair ; using pll = pair; constexpr int INF = 1e9; constexpr long long LINF = 1e17; constexpr int MOD = 1000000007; constexpr double PI = 3.14159265358979323846; int main(){ int n; scanf("%d",&n); vector a(n),b(n); rep(i,n) scanf("%d",&a[i]); rep(i,n) scanf("%d",&b[i]); int ans = 0; bool now = false; rep(i,n){ if(a[i]!=b[i]){ if(now) continue; else{ now = true; ++ans; } }else{ if(now) now = false; } } printf("%d\n",ans); return 0; }