#K76272. Calculate Total Production Cost

    ID: 34606 Type: Default 1000ms 256MiB

Calculate Total Production Cost

Calculate Total Production Cost

You are given several types of widgets. For each widget type, you are provided with three integers:

  • Wi — the number of widgets of type i,
  • Pi — the number of parts needed per widget of type i,
  • Ci — the cost of each part.

Your task is to compute the total production cost using the formula:

$$Total\ Cost = \sum_{i=1}^{N} \left(W_i \times P_i \times C_i\right)$$

where N is the number of widget types.

inputFormat

The first line of the input contains a single integer N, representing the number of widget types. Following that, there are N lines, each containing three space-separated integers Wi, Pi, and Ci respectively.

outputFormat

Output a single integer, which is the total production cost computed using the given formula.

## sample
3
10 2 5
5 3 10
8 1 7
306