#K41147. Taco Relay Teams

    ID: 26801 Type: Default 1000ms 256MiB

Taco Relay Teams

Taco Relay Teams

You are given n countries. Each country provides counts for three disciplines: running, cycling, and swimming. In each country, the numbers represent the available runners, cyclists, and swimmers respectively.

A valid relay team in this problem is defined simply as one runner, one cyclist, and one swimmer chosen from the entire pool of available participants. The total number of teams is computed by multiplying the total number of runners, the total number of cyclists, and the total number of swimmers across all countries.

Note: Although the narrative mentions teams from different countries, for the purpose of this problem you are to sum up each discipline count over all countries and then take their product, i.e., if \(R\) is the sum of runners, \(C\) is the sum of cyclists, and \(S\) is the sum of swimmers, then the answer is \(R \times C \times S\).

Input/Output: Read input from stdin and write the answer to stdout.

inputFormat

The first line contains an integer n representing the number of countries. The following n lines each contain three space-separated integers, indicating the number of runners, cyclists, and swimmers available from that country.

For example:

3
2 0 0
0 2 0
0 0 2

outputFormat

Output a single integer: the product of the total number of runners, the total number of cyclists, and the total number of swimmers.

For the sample input above, the output is 8 because \( (2+0+0) \times (0+2+0) \times (0+0+2) = 2 \times 2 \times 2 = 8 \).

## sample
3
2 0 0
0 2 0
0 0 2
8