n = int(input()) alst = list(map(int, input().split())) blst = list(map(int, input().split())) ans = 0 flg = False for a, b in zip(alst, blst): if (a != b) and (not flg): ans += 1 flg = True elif a == b: flg = False print(ans)