import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) A=[int(i) for i in input().split()] B=[int(i) for i in input().split()] ans=0 st=0 for i in range(n): if A[i]==B[i] and st==1: ans+=1 st=0 elif A[i]!=B[i] and st==0: st=1 if st==1: ans+=1 print(ans)