#include using namespace std; ////////////////// #ifdef DEBUG #include "debug.h" #define dump(...) \ DUMPOUT << " " << string(#__VA_ARGS__) << ": " \ << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]" \ << endl \ << " ", \ dump_func(__VA_ARGS__) #else #define dump(...) #endif // http://beet-aizu.hatenablog.com/entry/2018/04/08/145516 template vector make_v(size_t a){return vector(a);} template auto make_v(size_t a,Ts... ts){ return vector(ts...))>(a,make_v(ts...)); } template typename enable_if::value==0>::type fill_v(T &t,const V &v){t=v;} template typename enable_if::value!=0>::type fill_v(T &t,const V &v){ for(auto &e:t) fill_v(e,v); } ////////////////// #define int long long #define rep(i,n) for(int i=0, i##_len=(n); i bool chmax(T &a, const T &b) { if (a bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } /* #define mod 1000000007 /*/ #define mod 998244353 //*/ typedef pair P; #define INF (1LL<<60) void solve(){ int N; cin >> N; vector A(N), B(N); rep(i,N) cin >> A[i]; rep(i,N) cin >> B[i]; int ans = 0; bool same = true; rep(i,N){ if(A[i]!=B[i]){ if(same){ ans++; same=false;} }else{ if(!same){ same=true;} } } cout << ans << endl; } signed main(){ cout << fixed << setprecision(18); // cerr << fixed << setprecision(18); solve(); }