跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F2728. Tiling with Hexagons

    ID: 2734 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 2 上传者: 标签>模拟数学编程与模拟基础难度共享题库Codeforces英文题面题目来源题面语言

Tiling with Hexagons

题目描述

A. Tiling with Hexagons
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Several ages ago Berland was a kingdom. The King of Berland adored math. That's why, when he first visited one of his many palaces, he first of all paid attention to the floor in one hall. The floor was tiled with hexagonal tiles.

The hall also turned out hexagonal in its shape. The King walked along the perimeter of the hall and concluded that each of the six sides has a, b, c, a, b and c adjacent tiles, correspondingly.

To better visualize the situation, look at the picture showing a similar hexagon for a=2, b=3 and c=4.

According to the legend, as the King of Berland obtained the values a, b and c, he almost immediately calculated the total number of tiles on the hall floor. Can you do the same?

Input

The first line contains three integers: a, b and c (2≤a,b,c≤1000).

Output

Print a single number − the total number of tiles on the hall floor.

Examples
Input
2 3 4
Output
18

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 2395 题。保留原作者与原赛事署名。