import math import sys def S(): return sys.stdin.readline().rstrip() def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int, sys.stdin.readline().rstrip().split()) def LI(): return list(map(int, sys.stdin.readline().rstrip().split())) def LS(): return list(sys.stdin.readline().rstrip().split()) n = I() a = LI() b = LI() cnt = 0 ans = 0 for i in range(n): if a[i] != b[i]: cnt += 1 else: if cnt > 0: ans += 1 cnt = 0 else: continue if cnt > 0: ans += 1 print(ans)