Window

Given N panes of size W by H, slide odd-indexed panes east and even-indexed panes west by given distances, then compute the uncovered window area.

Medium4ArraySimulationImplementationIntervalsInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

The Jewelry Art Gallery (JAG) building has a long corridor running east to west. A window sits on the north side of the corridor, and NN windowpanes are mounted in it. Each pane is WW wide and HH tall. Measured from the west edge of the window, the ii-th pane from the west covers the horizontal range from W×(i1)W \times (i - 1) to W×iW \times i.

Illustration of the window

Figure A1. Structure of the window

The manager of JAG told you how to slide the panes. The instructions are NN integers x1,x2,,xNx_1, x_2, \dots, x_N, and xiWx_i \le W holds for every ii. If ii is odd, slide the ii-th pane east by xix_i. If ii is even, slide it west by xix_i.

The panes never collide, even after you follow the instructions, because the NN panes hang on two rails in alternation. A pane with odd ii is attached to the inner rail of the building, and a pane with even ii is attached to the outer rail.

Before carrying out the instructions, you want to know the area of the window that is open once they are done.

Input

The input is a single test case in the format below.

N H W
x1 ... xN

The first line has three integers NN, HH, and WW (1N1001 \le N \le 100, 1H,W1001 \le H, W \le 100). NN is even. The second line has the NN integers x1,,xNx_1, \dots, x_N that represent the manager's instructions. xix_i is the distance the ii-th pane slides (0xiW0 \le x_i \le W).

Output

Print the area of the window that is open after the instructions, on one line.

Hint

Illustration of the first example

Figure A2. Illustration of the first example