#include using namespace std; typedef long long ll; #define REP(i,n) for(int i=0; i #define VP vector> #define VPP vector>> #define VLL vector #define VVI vector> #define VVLL vector> #define VC vector #define VS vector #define VVC vector> #define VB vector #define VVB vector> #define fore(i,a) for(auto &i:a) typedef pair P; template using min_priority_queue = priority_queue, greater>; template bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } const int INF = 1 << 29; const ll INFL = 1LL << 60; const ll mod = 1000000007; int main(){ cin.tie(0); ios::sync_with_stdio(0); int n; cin >> n; VI a(n), b(n); REP(i, n)cin >> a[i]; REP(i, n)cin >> b[i]; int ans = 0; REP(i, n - 1) { if (a[i] == b[i] && a[i + 1] != b[i + 1]) { ans++; } } if (a[0] != b[0])ans++; cout << ans << endl; }