N = int(input()) *A, = map(int,(input().split())) *B, = map(int,(input().split())) if A[0] == B[0]: count=0 else: count=1 for i in range(N-1): if A[i]==B[i]: if A[i]==B[i] and A[i+1] != B[i+1]: count +=1 else: if A[i] != B[i] and A[i+1] == B[i+1]: count +=0 print(count)