n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) print(sum(x * y for x, y in zip(a, b)))