import java.io.*; import java.util.*; public class B_CoinPlay { private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); private static StringTokenizer st; private static int readInt() throws IOException { while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine()); return Integer.parseInt(st.nextToken()); } private static int[] readIntArray(final int n) throws IOException { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i]= readInt(); return a; } public static void main(String[] args) throws IOException { int N = readInt(); int[] A = readIntArray(N); int[] B = readIntArray(N); int count = 0; boolean theSame = true; for (int i = 0; i < N; i++) { if (A[i] == B[i]) theSame = true; else { if (theSame) count ++; theSame = false; } } System.out.println(count); } }