N = int(input()) lA = list(map(int, input().split())) lB = list(map(int, input().split())) ans = 0 f = 0 for i in range(N): if lA[i] == lB[i] and f == 1: ans +=1 f = 0 elif lA[i] != lB[i]: f = 1 if f == 1: print(ans + 1) else: print(ans)