#include #define REP(i, n) for (int i = 1; i <= n; i++) using namespace std; int n, ans; bool a[1000010], b[1000010], c[1000010]; signed main() { cin >> n; REP(i, n) { cin >> a[i]; } REP(i, n) { cin >> b[i]; } REP(i, n) { c[i] = a[i] ^ b[i]; } REP(i, n) { if (!c[i - 1] && c[i]) { ans++; } } cout << ans << endl; }