import numpy as np def main(): n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) arr = [0] + list(map(int, np.logical_xor(a, b))) ans = len([i for i in range(n) if arr[i:i + 2] == [0, 1]]) print(ans) if __name__ == "__main__": main()