import sys input = sys.stdin.buffer.readline N = int(input()) A = list(input().split()) B = list(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)