Given N items (0 < N <= 50) with prices (which are always integers) P0 ... PN-1 and given amounts of each item A0 ... AN-1, determine how much the total cost will be.

Examples

N: 2P0: 2P1: 3A0: 1A1: 4
Result: 14

N: 5P0: 2P1: 7P2: 5P3: 1P4: 9A0: 1A1: 2A2: 3A3: 2A4: 3
Result: 60

Remember, this is code-golf, so the code with the smallest number of bytes wins.

Leaderboards

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

# Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

# Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the leaderboard snippet:

A built-in computing the dot product between two input vectors: if, for each 1 &leq; i &leq; n, we buy ai items worth pi each, the formula for the total cost is a1p1 + a2p2 + … +anpn, which is precisely the definition of the dot product.

Your Answer

If this is an answer to a challenge…

…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.

…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.

…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.

More generally…

…Please make sure to answer the question and provide sufficient detail.

…Avoid asking for help, clarification or responding to other answers (use comments instead).

Code Golf Stack Exchange is a site for recreational programming competitions, not general programming questions. Challenges must have an objective scoring criterion, and it is highly recommended to first post proposed challenges in the Sandbox.