N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) ans = 0 i = 0 while i < N: if A[i] == B[i]: i += 1 continue if A[i] != B[i]: ans += 1 while i < N and A[i] != B[i]: i += 1 print(ans)