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.io.BufferedWriter;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;
import java.util.Arrays;
import java.io.InputStream;
import java.util.Random;
import java.util.Collection;
import java.io.OutputStreamWriter;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        final int max = 1000*1000;
        int n = in.readInt();
        int[] cnt = new int[max + 1];
        for (int i = 0; i < n; i++) {
            cnt[in.readInt()]++;
        }
        boolean canDecrease = true;
        for (int len = max; len >= 1; len--) {
            if (cnt[len] % 2 == 1) {
                cnt[len]--;
                if (canDecrease) {
                    cnt[len - 1]++;
                    if (cnt[len - 1] == 1) {
                        canDecrease = false;
                    }
                } else {
                    canDecrease = true;
                }
            } else {
                canDecrease = true;
            }
        }
        EzIntCustomHeap heap = new EzIntCustomHeap(new EzIntComparator() {
            public int compare(int a, int b) {
                if (a > b) return -1;
                if (a < b) return 1;
                return 0;
            }
        });
        for (int len = max; len >= 1; len--) {
            if (cnt[len] % 2 != 0) {
                throw new RuntimeException();
            }
            for (int i = 0; i < cnt[len]; i++) {
                heap.add(len);
            }
        }
long ans = 0;
        while (heap.size() >= 4) {
            int a = heap.removeFirst();
            int b = heap.removeFirst();
            if (a != b) {
                throw new RuntimeException();
            }
            int c = heap.removeFirst();
            int d = heap.removeFirst();
            if (c != d) {
                throw new RuntimeException();
            }
            ans += (long)a * c;
        }
        out.printLine(ans);
    }
}

class InputReader {

    private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

    public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

    public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	public static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

    public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}

class OutputWriter {
	private final PrintWriter writer;

	public OutputWriter(OutputStream outputStream) {
		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
	}

    public void close() {
		writer.close();
	}

    public void printLine(long i) {
		writer.println(i);
	}

}

class EzIntCustomHeap implements EzIntPriorityQueue {
    private static final int DEFAULT_CAPACITY = 10;
    private static final double ENLARGE_SCALE = 2.0;
    private static final int HASHCODE_INITIAL_VALUE = 0x811c9dc5;
    private static final int HASHCODE_MULTIPLIER = 0x01000193;

    private int[] heap;
    private int size;
    private EzIntComparator cmp;

    public EzIntCustomHeap(EzIntComparator cmp) {
        this(DEFAULT_CAPACITY, cmp);
    }

    public EzIntCustomHeap(int capacity, EzIntComparator cmp) {
        if (capacity < 0) {
            throw new IllegalArgumentException("Capacity must be non-negative");
        }
        heap = new int[capacity];
        size = 0;
        this.cmp = cmp;
    }

    private void up(int index) {
        final int element = heap[index];
        int parent = (index - 1) >>> 1;
        while (index > 0 && cmp.compare(element, heap[parent]) < 0) {
            heap[index] = heap[parent];
            index = parent;
            parent = (index - 1) >>> 1;
        }
        heap[index] = element;
    }

    private void down(int index) {
        final int element = heap[index];
        final int firstLeaf = size >>> 1;
        while (index < firstLeaf) {
            int smallestChild = (index << 1) + 1;
            if (smallestChild + 1 < size && cmp.compare(heap[smallestChild + 1], heap[smallestChild]) < 0) {
                smallestChild++;
            }
            if (cmp.compare(heap[smallestChild], element) >= 0) {
                break;
            }
            heap[index] = heap[smallestChild];
            index = smallestChild;
        }
        heap[index] = element;
    }

    public int size() {
        return size;
    }

    public int[] toArray() {
        int[] result = new int[size];
        System.arraycopy(heap, 0, result, 0, size);
        return result;
    }

    public boolean add(int element) {
        if (size == heap.length) {
            enlarge();
        }
        heap[size] = element;
        up(size++);
        return true;
    }

    public int removeFirst() {
        if (size == 0) {
            throw new NoSuchElementException("Trying to call removeFirst() on empty Heap");
        }
        final int firstElement = heap[0];
        heap[0] = heap[--size];
        down(0);
        return firstElement;
    }

    private void enlarge() {
        int newSize = Math.max(size + 1, (int) (size * ENLARGE_SCALE));
        int[] newArray = new int[newSize];
        System.arraycopy(heap, 0, newArray, 0, size);
        heap = newArray;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        EzIntCustomHeap that = (EzIntCustomHeap) o;

        if (size != that.size) {
            return false;
        }
        int[] thisArray = toArray();
        int[] thatArray = that.toArray();
        EzIntCustomSort.sort(thisArray, cmp);
        EzIntCustomSort.sort(thatArray, cmp);
        for (int i = 0; i < size; i++) {
            if (thisArray[i] != thatArray[i]) {
                return false;
            }
        }
        return true;
    }

    public int hashCode() {
        int[] array = toArray();
        EzIntCustomSort.sort(array, cmp);
        int hash = HASHCODE_INITIAL_VALUE;
        for (int i = 0; i < size; i++) {
            hash = (hash ^ PrimitiveHashCalculator.getHash(array[i])) * HASHCODE_MULTIPLIER;
        }
        return hash;
    }

    public String toString() {
        int[] array = toArray();
        EzIntCustomSort.sort(array, cmp);
        StringBuilder sb = new StringBuilder();
        sb.append('[');
        for (int i = 0; i < size; i++) {
            sb.append(array[i]);
            if (i < size - 1) {
                sb.append(", ");
            }
        }
        sb.append(']');
        return sb.toString();
    }

}

interface EzIntComparator {
    int compare(int a, int b);
}

interface EzIntPriorityQueue extends EzIntCollection {

    boolean equals(Object object);

    int hashCode();

    String toString();

}

interface EzIntCollection {

    boolean equals(Object object);

    int hashCode();

    String toString();
}

class EzIntCustomSort {
    private static final double HEAPSORT_DEPTH_COEFFICIENT = 2.0;

    private static final Random rnd = new Random();

    private static int maxQuickSortDepth(int length) {
        if (length <= 1) {
            return 0;
        }
        int log = Integer.numberOfTrailingZeros(Integer.highestOneBit(length - 1)) + 1;
        return (int) (HEAPSORT_DEPTH_COEFFICIENT * log);
    }

    public static void sort(int[] a, EzIntComparator cmp) {
        quickSort(a, 0, a.length, cmp, 0, maxQuickSortDepth(a.length));
    }

    private static void quickSort(int[] a, int left, int right, EzIntComparator cmp, int depth, int maxDepth) {
        if (right - left <= 1) {
            return;
        }
        if (depth > maxDepth) {
            heapSort(a, left, right - left, cmp);
            return;
        }
        final int pivot = a[left + rnd.nextInt(right - left)];
        int i = left;
        int j = right - 1;
        do {
            while (cmp.compare(a[i], pivot) < 0) i++;
            while (cmp.compare(pivot, a[j]) < 0) j--;
            if (i <= j) {
                int tmp = a[i];
                a[i++] = a[j];
                a[j--] = tmp;
            }
        } while (i <= j);
        quickSort(a, left, j + 1, cmp, depth + 1, maxDepth);
        quickSort(a, i, right, cmp, depth + 1, maxDepth);
    }

    private static void heapSort(int[] a, int offset, int size, EzIntComparator cmp) {
        for (int i = (size >>> 1) - 1; i >= 0; i--) {
            down(a, i, offset, size, cmp);
        }
        for (int i = size - 1; i > 0; i--) {
            int tmp = a[offset];
            a[offset] = a[offset + i];
            a[offset + i] = tmp;
            down(a, 0, offset, i, cmp);
        }
    }

    private static void down(int[] a, int index, int offset, int size, EzIntComparator cmp) {
        final int element = a[offset + index];
        final int firstLeaf = (size >>> 1);
        while (index < firstLeaf) {
            int largestChild = (index << 1) + 1;
            if (largestChild + 1 < size && cmp.compare(a[offset + largestChild + 1], a[offset + largestChild]) > 0) {
                largestChild++;
            }
            if (cmp.compare(a[offset + largestChild], element) <= 0) {
                break;
            }
            a[offset + index] = a[offset + largestChild];
            index = largestChild;
        }
        a[offset + index] = element;
    }
}

class PrimitiveHashCalculator {

    public static int getHash(int x) {
        return x;
    }

}

