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

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 a1, a2, a3 and a4 can make a rectangle if the following properties are observed:

  * a1 ≤ a2 ≤ a3 ≤ a4
  * a1 = a2
  * a3 = a4



A rectangle can be made of sticks with lengths of, for example, 3 3 3 3 or 2 2 4 4. A rectangle cannot be made of, for example, sticks 5 5 5 7.

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 5 can either stay at this length or be transformed into a stick of length 4.

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 n (1 ≤ n ≤ 105) — the number of the available sticks.

The second line of the input contains n positive integers li (2 ≤ li ≤ 106) — 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.

Examples

Input

4
2 4 4 2


Output

8


Input

4
2 2 3 5


Output

0


Input

4
100003 100004 100005 100006


Output

10000800015
import java.util.StringTokenizer;
import java.util.Collections;
import java.util.Collection;
import java.util.Set;
import java.util.HashSet;
import java.util.Map;
import java.util.HashMap;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Queue;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Stack;
import java.util.Vector;
import java.util.Hashtable;
import java.util.Iterator;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.FileReader;

import java.math.BigInteger;

public class Main
{

	static PrintWriter writer;
	static StringTokenizer sz;
	static BufferedReader reader;

	public static void main(String[] args)
	throws Exception
	{
		declare();

		int v,n = readInt();
		int freq[] = new int[1000001];
		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;

		readLine();
		for (int i=1;i <= n;++i)
		{
			++freq[v = readInt()];

			if (v > max)
				max = v;

			if (v < min)
				min = v;
		}

		int mod[] = new int[1000001];
		int h,count,fr,md;
		h = count = 0;
		long ans = 0;

		for (int i=max;i >= min;)
		{
			fr = freq[i];
			md = mod[i];
			v = fr + md;

			if (v >= 2)
			{
				if (v >= 4)
				{
					if (count == 0)
					{
						ans += (long)i * i;

						if (md >= 4)
						{
							mod[i - 1] = fr;
							md -= 4;
							v -= 4;
						}
						else
						if (md == 3)
						{
							mod[i - 1] = fr = fr - 1;
							md -= 3;
						}
						else 
						if (md == 2)
						{
							mod[i - 1] = fr = fr - 2;
							md -= 2;
						}
						else
						if (md == 1)
						{
							mod[i - 1] = fr = fr - 3;
							--md;

						}
						else
						{
							mod[i - 1] = fr = fr - 4;
						}

						v -= 4;

					}
					else
					{
						ans += (long)h * i;

						if (md >= 2)
						{
							mod[i - 1] = fr;
							md -= 2;
						}
						else 
						if (md == 1)
						{
							mod[i - 1] = fr = fr - 1;
							--md;
						}
						else
							mod[i - 1] = fr = fr - 2;

						v -= 2;
						count = 0;
					}

				} // 4
				else 
				if (v >= 2)
				{
					++count;

					if (count == 1)
						h = i;
					else
					if (count == 2)
					{
						ans += (long)h * i;
						count = 0;
					}

					if (md >= 2)
					{
						mod[i - 1] = fr;
						md -= 2;
					}
					else 
					if (md == 1)
					{
						mod[i - 1] = fr = fr - 1;
						md -= 1;
					}
					else
						mod[i - 1] = fr = fr - 2;

					v -= 2;
				} // 2

				if (v >= 2)
				{
					mod[i] = md;
					freq[i] = fr;
				}
				else
				{
					mod[i-1] = fr;
					--i;
				}


			} // if main
			else
			{
				mod[i - 1] = fr;
				--i;
			} // else main
			
			
		} // test

		writer.print(ans);

		close();
	}

	private static class Pair implements Comparable<Pair>
	{
		int first,second;

		public Pair(int f, int s)
		{
			first = f;
			second = s;
		}

		@Override
		public int compareTo(Main.Pair p1)
		{
			if (first == p1.first)
				return  second - p1.second;
			return first - p1.first;
		}

		@Override
		public String toString()
		{
			return first + " " + second;
		}
	}

	private static String readString()
	throws IOException
	{
		if (sz.hasMoreTokens())
			return sz.nextToken();
		return reader.readLine();
	}

	private static void readLine()
	throws IOException
	{
		sz = new StringTokenizer(reader.readLine());
	}

	private static int readInt()
	throws IOException
	{
		if (sz.hasMoreTokens())
			return Integer.parseInt(sz.nextToken());
		return Integer.parseInt(reader.readLine());
	}

	private static long readLong()
	throws IOException
	{
		if (sz.hasMoreTokens())
			return Long.parseLong(sz.nextToken());
		return Long.parseLong(reader.readLine());
	}

	private static void declare()
	{
		writer = new PrintWriter(System.out);
		reader = new BufferedReader(
			new InputStreamReader(System.in));
		sz = new StringTokenizer("");
	}

	private static void declareFile()
	throws IOException
	{
		writer = new PrintWriter("output.txt");
		reader = new BufferedReader(
			new FileReader("input.txt"));
		sz = new StringTokenizer("");
	}

	private static void close()
	throws IOException
	{
		reader.close();
		writer.flush();
		writer.close();
	}
}

  




  


