407032: GYM102697 003 Triangle Sum

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

003. Triangle Sumtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Triangles are one of the simplest geometric shapes. Equilateral triangles have the special property of all three of their sides being equal to each other. In this problem, you will be given a list of side lengths of equilateral triangles. You should find the sum of the perimeters of the triangles, given that the triangles are all equilateral.

Input

The first line of the input will contain a positive integer n indicating the number of triangles. Each of the next n lines will contain an integer t, indicating the side length of each triangle.

Output

Print one number, the calculated sum of the perimeters of the triangles.

ExampleInput
3
3
4
6
Output
39
Note

In the example, the first triangle has a side length of 3, so it has a perimeter of 9. The second triangle has a perimeter of 12, and the third triangle has a perimeter of 18.

加入题单

上一题 下一题 算法标签: