N = int(input()) A = map(int, input().split()) B = map(int, input().split()) ans = 0 changing = False for a, b in zip(A, B): if not changing and a != b: ans += 1 changing = a != b print(ans)