#include #define rep(a,n) for (ll a = 0; a < (n); ++a) using namespace std; using ll = long long; typedef pair P; typedef pair PP; typedef vector > Graph; 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; } const ll INF = 1e18; int main(){ ll n; cin >> n; vectora(n),b(n); rep(i,n)cin>>a[i]; rep(i,n)cin>>b[i]; ll cnt = 0; vectorsame; same.push_back(true); rep(i,n){ if(a[i]==b[i]){ same.push_back(true); } else{ same.push_back(false); } } same.push_back(true); rep(i,n+1){ if(same[i]&&(!same[i+1]))cnt++; } cout << cnt << endl; return 0; }