#c221104. 能量采集

能量采集

Energy Harvest

Problem Source

NOI2010

Problem Description

Dongdong has a rectangular piece of land on which he grows an energy plant that can collect solar energy. After the plants collect energy, Dongdong uses an energy collector to gather all the collected energy together.

The plants are planted very neatly: there are nn columns, each with mm plants, and the horizontal and vertical spacing between plants is identical. Therefore, for each plant, Dongdong can represent its position with a coordinate (x,y)(x, y), where xx ranges from 11 to nn and yy ranges from 11 to mm, meaning it is the yy-th plant in the xx-th column.

Because the energy collector is large and inconvenient to move, Dongdong places it in a corner, exactly at coordinate (0,0)(0, 0).

There is some energy loss while the collector gathers energy. If the line segment connecting a plant to the collector contains kk other plants, the energy loss is 2k+12k + 1. For example, when the collector gathers the plant at (2,4)(2, 4), since there is a plant (1,2)(1, 2) on the connecting segment, an energy loss of 33 is produced. Note that if there are no other plants on the segment connecting a plant to the collector, the energy loss is 11. Compute the total energy loss.

Input Format

One line containing two integers n,mn, m (1≤n,m≤1051 \leq n, m \leq 10^5).

Output Format

A single integer: the total energy loss.

Sample Input 1

5 4

Sample Output 1

36

Sample Input 2

3 4

Sample Output 2

20