[백준][Python] 13305번 주유소
n = int(input())
length = list(map(int,input().split()))
price = list(map(int,input().split()))
min_value = price[0]
cost = 0
for i in range(len(length)):
if price[i] < min_value:
min_value = price[i]
cost += min_value * length[i]
print(cost)