mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) ans = 0 flg = 0 for a, b in zip(A, B): if flg == 0: if a != b: flg = 1 else: if a == b: flg = 0 ans += 1 if flg == 1: ans += 1 print(ans) if __name__ == '__main__': main()