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