Pasha assembled box of bricks in the form of a rectangular parallelepiped and thought over the question: what is a minimal number of bricks lay on the route between two opposite corners of the parallelepiped, if it is allowed to pass from brick to other brick through the common face, edge or vertex? In the figure opposite bricks are highlighted.
Help Pasha to write a program that calculates minimal number of bricks on the route.
Integer n, m, k (1 ≤ n, m, k ≤ 1000) – the size of rectangular parallelepiped (in bricks).
Integer – the minimal number of bricks.