n=int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) lis=[0]*n for i in range(n): if a[i]==b[i]: lis[i] = 1 ans=0 cnt=0 for i in range(n): if lis[i] == 0: cnt=1 if i == n-1: ans+=cnt elif lis[i+1] == 0: pass else: ans+=cnt cnt=0 print(ans)