Author: | A. Karabanov | Time limit: | 1 sec | |
Input file: | Standard input | Memory limit: | 64 Mb | |
Output file: | Standard output |
Timofey was sitting on a math test. His test was completed, he even solved the test of his neighbour, beautiful Alena. Timofey was bored, so he started to draw on checkered sheet of paper.
At first, he drew a square with lines, parallel to sheet sides, and marked all vertices of this square. Then he marked additional a points on the first side of square, b additional points on second side of the square, c additional points on the third side and d aaditional points on the last side. Now he is interested, how many different nondegenerate triangles with vertices in marked points are there?
The only line of input contains four space-separated natural numbers: a, b, c ї d.
Print one integer — number of different nondegenerate triangles with vertices in marked points.
0≤a+b+c+d≤1000
No. | Standard input | Standard output |
---|---|---|
1 |
|
|
2 |
|
|