#P525C. Ilya and Sticks

Ilya and Sticks

Description

In the evening, after the contest Ilya was bored, and he really felt like maximizing. He remembered that he had a set of nn sticks and an instrument. Each stick is characterized by its length lil_i.

Ilya decided to make a rectangle from the sticks. And due to his whim, he decided to make rectangles in such a way that maximizes their total area. Each stick is used in making at most one rectangle, it is possible that some of sticks remain unused. Bending sticks is not allowed.

Sticks with lengths a1a_1, a2a_2, a3a_3, and a4a_4 can make a rectangle if the following properties are observed:

  • a1a2a3a4a_1 \leq a_2 \leq a_3 \leq a_4
  • a1=a2a_1 = a_2
  • a3=a4a_3 = a_4

A rectangle can be made of sticks with lengths of, for example, 33 33 33 33 or 22 22 44 44. A rectangle cannot be made of, for example, sticks 55 55 55 77.

Ilya also has an instrument which can reduce the length of the sticks. The sticks are made of a special material, so the length of each stick can be reduced by at most one. For example, a stick with length 55 can either stay at this length or be transformed into a stick of length 44.

You have to answer the question — what maximum total area of the rectangles can Ilya get with a file if makes rectangles from the available sticks?

Input

The first line of the input contains a positive integer nn (1n1051 \leq n \leq 10^5) — the number of the available sticks.

The second line of the input contains nn positive integers lil_i (2li1062 \leq l_i \leq 10^6) — the lengths of the sticks.

Output

The first line of the output must contain a single non-negative integer — the maximum total area of the rectangles that Ilya can make from the available sticks.

4
2 4 4 2

4
2 2 3 5

4
100003 100004 100005 100006

8

0

10000800015