import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007

class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    val MAX = 1_000_000
    val N = ni()
    val C = java.util.TreeMap<Int, Int>()
    for (i in 0 until N) {
      val a = ni()
      C.merge(a, 1, Int::plus)
    }

    var ans = 0L

    var i = C.lastKey()
    val lines = ArrayDeque<Long>()
    while(i != null) {
      if (C.getOrDefault(i, 0) + C.getOrDefault(i + 1, 0) >= 2) {
        var c = 2
        for (j in 1 downTo 0) {
          val v = min(c, C.getOrDefault(i + j, 0))
          c -= v
          C.merge(i + j, -v, Int::plus)
        }
        lines.add(i.toLong())
      } else {
        i = C.lowerKey(i)
      }
    }

    while(lines.size >= 2) {
      ans += lines.pop() * lines.pop()
    }
    out.println(ans)
  }

  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n, offset) { ni() }
  }

  private inline fun map(n: Int, offset: Int = 0, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i + offset)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }
}

fun <A, B> pair(a: A, b: B) = RPair(a, b)
data class RPair<A, B>(val _1: A, val _2: B)

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007

class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    val MAX = 1_000_000
    val N = ni()
    val C = IntArray(MAX + 10)
    for (i in 0 until N) {
      val a = ni()
      C[a]++
    }
    fun find(): Long? {
      for (i in MAX downTo 2) {
        if (C[i] + C[i + 1] >= 2) {
          var c = 2
          for (j in 1 downTo 0) {
            val v = min(c, C[i + j])
            c -= v
            C[i + j] -= v
          }
          return i.toLong()
        }
      }
      return null
    }

    val a = find()
    val b = find()
    if (a != null && b != null){
      out.println(a * b)
    } else {
      out.println(0)
    }
  }

  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n, offset) { ni() }
  }

  private inline fun map(n: Int, offset: Int = 0, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i + offset)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }
}

fun <A, B> pair(a: A, b: B) = RPair(a, b)
data class RPair<A, B>(val _1: A, val _2: B)

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define GETINT(X) scanf("%d",&X)
#define GETLL(X) scanf("%lld",&X)
typedef long long int LL;

int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}
int main()
{
    int arr[100008];

    int i,n;
    scanf("%d",&n);

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
    long long ar,l,b;
    qsort(arr,n,sizeof(int),cmp);

    for(i=n-1;i>=3;i--)
    {
        if(arr[i-1]>=arr[i]-1)
            l=arr[i]==arr[i-1]?arr[i]:arr[i-1];
        else
        {
            continue;
        }
        if(arr[i-3]>=arr[i-2]-1)
            b=arr[i-2]==arr[i-3]?arr[i-2]:arr[i-3];
        else
            continue;
        ar=ar+l*b;
    }

    printf("%lld\n",ar);

return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define GETINT(X) scanf("%d",&X)
#define GETLL(X) scanf("%lld",&X)
typedef long long int LL;

int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}
int main()
{
    int arr[100008];

    int i,n;
    scanf("%d",&n);

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
    long long ar,l,b;
    qsort(arr,n,sizeof(int),cmp);
    ar=0;
    for(i=n-1;i>=3;i--)
    {
        if(arr[i-1]>=arr[i]-1)
            l=arr[i]==arr[i-1]?arr[i]:arr[i-1];
        else
        {
            continue;
        }
        if(arr[i-3]>=arr[i-2]-1)
            b=arr[i-2]==arr[i-3]?arr[i-2]:arr[i-3];
        else
        {
            i=i-3;
            while(arr[i-1]<arr[i]-1 && i>=1)
                i--;
            if(arr[i-1]<arr[i])
                continue;
            b=arr[i]==arr[i-1]?arr[i]:arr[i-1];
            ar=ar+l*b;
            i=i-1;
            continue;
        }
        ar=ar+l*b;
        i=i-3;
    }

    printf("%lld\n",ar);

return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define GETINT(X) scanf("%d",&X)
#define GETLL(X) scanf("%lld",&X)
typedef long long int LL;

int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}
int main()
{
    int arr[100008];

    int i,n;
    scanf("%d",&n);

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
    long long ar,l,b;
    qsort(arr,n,sizeof(int),cmp);
    ar=0;
    for(i=n-1;i>=3;i--)
    {
        if(arr[i-1]>=arr[i]-1)
            l=arr[i]==arr[i-1]?arr[i]:arr[i-1];
        else
        {
            continue;
        }
        if(arr[i-3]>=arr[i-2]-1)
            b=arr[i-2]==arr[i-3]?arr[i-2]:arr[i-3];
        else
            continue;
        ar=ar+l*b;
    }

    printf("%lld\n",ar);

return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define GETINT(X) scanf("%d",&X)
#define GETLL(X) scanf("%lld",&X)
typedef long long int LL;

int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}
int main()
{
    int arr[100008];

    int i,n;
    scanf("%d",&n);

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
    long long ar,l,b;
    qsort(arr,n,sizeof(int),cmp);
    ar=0;
    for(i=n-1;i>=3;i--)
    {
        if(arr[i-1]>=arr[i]-1)
            l=arr[i]==arr[i-1]?arr[i]:arr[i-1];
        else
        {
            continue;
        }
        if(arr[i-3]>=arr[i-2]-1)
            b=arr[i-2]==arr[i-3]?arr[i-2]:arr[i-3];
        else
        {
            i=i-3;
            while(arr[i-1]<arr[i]-1 && i>=1)
                i--;
            if(i==0)
                continue;
            b=arr[i]==arr[i-1]?arr[i]:arr[i-1];
            ar=ar+l*b;
            i=i-1;
            continue;
        }
        ar=ar+l*b;
        i=i-3;
    }

    printf("%lld\n",ar);

return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define GETINT(X) scanf("%d",&X)
#define GETLL(X) scanf("%lld",&X)
typedef long long int LL;

int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}
int main()
{
    int arr[100008];

    int i,n;
    scanf("%d",&n);

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
    long long ar,l,b;
    qsort(arr,n,sizeof(int),cmp);
    ar=0;
    for(i=n-1;i>=3;i--)
    {
        if(arr[i-1]>=arr[i]-1)
            l=arr[i]==arr[i-1]?arr[i]:arr[i-1];
        else
        {
            continue;
        }
        if(arr[i-3]>=arr[i-2]-1)
            b=arr[i-2]==arr[i-3]?arr[i-2]:arr[i-3];
        else
        {
            i=i-3;
            while(arr[i-1]<arr[i]-1)
                i--;
            b=arr[i]==arr[i-1]?arr[i]:arr[i-1];
            ar=ar+l*b;
            i=i-1;
            continue;
        }
        ar=ar+l*b;
        i=i-3;
    }

    printf("%lld\n",ar);

return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define GETINT(X) scanf("%d",&X)
#define GETLL(X) scanf("%lld",&X)
typedef long long int LL;

int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}
int main()
{
    int arr[100008];

    int i,n;
    scanf("%d",&n);

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
    long long ar,l,b;
    qsort(arr,n,sizeof(int),cmp);
    ar=0;
    for(i=n-1;i>=3;i--)
    {
        if(arr[i-1]>=arr[i]-1)
            l=arr[i]==arr[i-1]?arr[i]:arr[i-1];
        else
        {
            continue;
        }
        if(arr[i-3]>=arr[i-2]-1)
            b=arr[i-2]==arr[i-3]?arr[i-2]:arr[i-3];
        else
        {
            i=i-3;
            while(arr[i-1]<arr[i]-1 && i>=1)
                i--;
            if(arr[i-1]<arr[i]-1)
                continue;
            b=arr[i]==arr[i-1]?arr[i]:arr[i-1];
            ar=ar+l*b;
            i=i-1;
            continue;
        }
        ar=ar+l*b;
        i=i-3;
    }

    printf("%lld\n",ar);

return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define GETINT(X) scanf("%d",&X)
#define GETLL(X) scanf("%lld",&X)
typedef long long int LL;

int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}
int main()
{
    int arr[100008];

    int i,n;
    scanf("%d",&n);

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
    long long ar,l,b;
    qsort(arr,n,sizeof(int),cmp);
    ar=0;
    for(i=n-1;i>=3;i--)
    {
        if(arr[i-1]>=arr[i]-1)
            l=arr[i]==arr[i-1]?arr[i]:arr[i-1];
        else
        {
            continue;
        }
        if(arr[i-3]>=arr[i-2]-1)
            b=arr[i-2]==arr[i-3]?arr[i-2]:arr[i-3];
        else
            continue;
        ar=ar+l*b;
        i=i-4;
    }

    printf("%lld\n",ar);

return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define GETINT(X) scanf("%d",&X)
#define GETLL(X) scanf("%lld",&X)
typedef long long int LL;

int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}
int main()
{
    int arr[100008];

    int i,n;
    scanf("%d",&n);

    for(i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }
    long long ar,l,b;
    qsort(arr,n,sizeof(int),cmp);
    ar=0;
    for(i=n-1;i>=3;i--)
    {
        if(arr[i-1]>=arr[i]-1)
            l=arr[i]==arr[i-1]?arr[i]:arr[i-1];
        else
        {
            continue;
        }
        if(arr[i-3]>=arr[i-2]-1)
            b=arr[i-2]==arr[i-3]?arr[i-2]:arr[i-3];
        else
            continue;
        ar=ar+l*b;
        i=i-3;
    }

    printf("%lld\n",ar);

return 0;
}


#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
int cmp(const void *a,const void *b)
{
	return (*(int *)a-*(int *)b);
}
int main()
{
	int n,i,l,r,a[1000005];
	long long ans;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	qsort(a,n,sizeof(int),cmp);
	/*for(i=0;i<n;i++)
		printf("%d ",a[i]);
	printf("\n");*/
	l=-1;r=-1;ans=0;
	for(i=(n-1);i>0;)
	{
		if(a[i]==a[i-1])
		{
			if(l==-1)
				l=a[i];
			else
				r=a[i];
			//printf("%d %d\n",l,r);
			i-=2;
		}
		else if(a[i-1]==a[i]-1)
		{
			if(l==-1)
				l=a[i-1];
			else
				r=a[i-1];
			//printf("%d %d\n",l,r);
			i-=2;
		}
		else
			i--;
		if((l!=-1)&&(r!=-1))
		{
			//printf("dim are %d %d\n",l,r);
			ans+=(((long long)l)*r);
			//printf("ans is %lld\n",ans);
			l=-1;r=-1;
		}
	}
	printf("%lld\n",ans);
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int cmp(const void *a,const void *b)
{
	return (*(int *)a-*(int *)b);
}
int main(void)
{
	int n,i,l,r,a[100005];
	long long int ans;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	qsort(a,n,sizeof(int),cmp);
	i=n-1;
	l=-1;
	r=-1;
	while(i>0)
	{
		if((l!=-1)&&(r!=-1))
			break;
		if(a[i]==a[i-1])
		{
			if(l==-1)
				l=a[i];
			else
				r=a[i];
			i-=2;
		}
		else if(a[i]-1==a[i-1])
		{
			if(l==-1)
				l=a[i-1];
			else
				r=a[i-1];
			i-=2;
		}
		else
			i--;
	}
	if((l==-1)||(r==-1))
		ans=0;
	else
		ans=((long long)l)*r;
	printf("%lld\n",ans);
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#define max 100001
long long int a[max];
int cmpfunc (const void * a, const void * b)
{
   return ( *(int*)b - *(int*)a );
}

main()
{  long long int n,i,j,k,sum,store,flag;
store=1;
sum=0;
    scanf("%I64d",&n);
    for(i=0;i<n;i++)
        scanf("%I64d",&a[i]);

    qsort(a,n,sizeof(long long int),cmpfunc);
    printf("\n");

    flag=0;
    for(i=0;i<n-1;i++)
    {
        if(flag==2)
        {
            sum=sum+store;
            store=1;
            flag=0;

        }

        if((a[i]==a[i+1]))
          {
              store=store*a[i];

              i=i+1;
              flag++;
              //printf("yo\n");
              continue;

          }

          if((a[i]==1+a[i+1]))

          {
              store=store*a[i+1];

              i=i+1;
              flag++;
              //printf("bo\n");
              continue;

          }

    }

    if(flag==2)
        {
            sum=sum+store;
            store=0;
            flag=0;

        }

    printf("%I64d",sum);

}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <math.h>
long long int compfnc(const void  *a,const void *b)
{
    return(*(int *)a - *(int *)b);
}
int main()
{
    long long int n;
    scanf("%I64d",&n);
    long long int a[n],i,a1=0,a3=0,j,x=0;
    for(i=0;i<n;i++){
        scanf("%I64d",&a[i]);
    }
    if(n<4){
        printf("0");
        return 0;
    }
    qsort(a,n,sizeof(long long int),compfnc);
    for(i=n-1;i>=1;i--){
        if(a[i]-a[i-1]==0 ||a[i]-a[i-1]==1 ){
            a1= a[i-1];
            for(j=i-2;j>=1;j--){
                if(a[j]-a[j-1]==0 ||a[j]-a[j-1]==1){
                    a3= a[j-1];
                    break;
                }
            }
            x+=a1*a3;
            i=j-1;
        }
    }

    printf("%I64d",x);

    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <math.h>
long long int compfnc(const void  *a,const void *b)
{
    return(*(int *)a - *(int *)b);
}
int main()
{
    long long int n;
    scanf("%I64d",&n);
    long long int a[n],i=n-1,a1=0,a3=0,j,x=0;
    for(i=0;i<n;i++){
        scanf("%I64d",&a[i]);
    }
    if(n<4){
        printf("0");
        return 0;
    }
    qsort(a,n,sizeof(long long int),compfnc);
    while(i>=1){
        a1=0;
        a3=0;
        if(a[i]-a[i-1]==0 ||a[i]-a[i-1]==1 ){
            a1= a[i-1];
            for(j=i-2;j>=1;j--){
                if(a[j]-a[j-1]==0 ||a[j]-a[j-1]==1){
                    a3= a[j-1];
                    break;
                }
            }
            x+=a1*a3;
            i=j-2;
        }
        else{
            i--;
        }
    }

    printf("%I64d",x);

    return 0;
}


#include<stdio.h>
int main(){
	int x,i,j,k,l,n,m,a[1000000];
	for(i=0;i<1000000;i++)
		a[i]=0;
	scanf("%d",&n);
	long long int one=0;
	int flag=0;
	long long int two=0;
	for(i=0;i<n;i++){
		scanf("%d",&x);
		a[x]++;
	}
	for(i=1;i<=5;i++)
		printf("%d ",a[i]);
	printf("\n");
	for(i=999999;i>=0;i--){
		if(a[i]>0 && flag==0){
			if(a[i]>1){
				one=i;
				flag=1;
			}
			else{
				if(a[i-1]>0){
					one = i-1;
					flag=1;
					i=i-2;
				}
			}
		}
		if(a[i]>0 && flag==1){
			if(a[i]>1)
				two = i;
			else{
				if(a[i-1]>0)
					two = i-1;
				flag=2;
			}
			if(flag==2)
				break;
		}
	}
//	printf("%lld %lld\n",one,two);
	printf("%lld\n",one*two);
	return 0;
}


#include<stdio.h>
int main(){
	int i,j,k,l,n,m,x;
	scanf("%d",&n);
	int max1=0;
	int max2=0;
	int max3=0;
	int max4=0;
	for(i=0;i<n;i++){
		scanf("%d",&x);
		if(x>=max1){
			max1 = x;
			if(x>=max2){
				max1 = max2;
				max2 = x;
				if(x>=max3){
					max2 = max3;
					max3 = x;
					if(x>=max4){
						max3 = max4;
						max4 = x;
					}
				}
			}
		}
	}
	long long int ans=0;
/*	if(>ans)
		ans = ((max4-max1)*(max3-max2));
	if(((max4-max3)*(max2-max1))>ans)
		ans = ((max4-max3)*(max2-max1));
	if(((max3-max1)*(max4-max2))>ans)
		ans = ((max3-max1)*(max4-max2));
	printf("%d %d %d %d\n",max1,max2,max3,max4);*/
	printf("%d\n",max1*max3);
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
long long int a[1000001],count[1000001],exist[1000001];
int main()
{
	long long int n,i,j,ans=0,max=0,temp,temp2,flag=0;
	scanf("%lld",&n);
	for(i=0;i<n;i++)
	{
		scanf("%lld",&a[i]);
		count[a[i]]++;
		exist[a[i]]=1;
		if(a[i]>max)max=a[i];
	}
	for(i=max;i>=1;i--)
	{
		if(exist[i]&&count[i]%2==1)
		{
			count[i]--;
			count[i-1]++;
		}
	}
	for(i=max;i>=1;i--)
	{
		if(exist[i]&&count[i])
		{
		if(flag)
		{
			ans+=i*temp2;
			count[i]-=2;
			flag=0;
		}
		temp=count[i]/4;
		if(temp)
		{
			ans+=(i*i*temp);
		}
		if(count[i]%4)
		{
			flag=1;
			temp2=i;
		}
		}
	}
	printf("%lld\n",ans);
	return 0;
}


#include<stdio.h>
#define LL long long int

void merge(LL arr[], int low, int mid, int high)
{
	int i = low;
	int j = mid+1;
	LL temp[high];
	int k = 0;
	while(i<=mid && j<= high)
	{
		if(arr[i]>arr[j])
			temp[k++] = arr[i++];
		else
			temp[k++] = arr[j++];
	}
	while(i<=mid)
	{
		temp[k++] = arr[i++];
	}
	while(j<=high)
	{
		temp[k++] = arr[j++];
	}
	k = 0;
	for(i=low; i<=high; i++)
	{
		arr[i] = temp[k++];
	}
}

void sort(LL arr[], int low, int high)
{
	if(low<high)
	{
		int mid = low+(high-low)/2;
		sort(arr, low, mid);
		sort(arr, mid+1, high);
		merge(arr, low, mid, high);
	}
}

int main()
{
	int n;
	scanf("%d", &n);
	LL arr[n];
	int i;
	for(i=0; i<n; i++)
		scanf("%I64d", &arr[i]);
	sort(arr, 0, n-1);

	LL l = 0, b = 0;
	i = 0;
	int count = 0;
	LL area = 0;
	while(i<n)
	{
		if(arr[i]==arr[i+1] || arr[i]==arr[i+1]+1)
		{
			if(count == 0)
			{
				l = arr[i+1];
				count++;
			}
			else
			{
				b = arr[i+1];
				area += l*b;
				count = 0;
			}
			i++;
		}
		i++;
	}
	printf("%I64d\n", area);
	return 0;
}


#include<stdio.h>
#define LL long long int

void merge(LL arr[], int low, int mid, int high)
{
	int i = low;
	int j = mid+1;
	LL temp[high];
	int k = 0;
	while(i<=mid && j<= high)
	{
		if(arr[i]>arr[j])
			temp[k++] = arr[i++];
		else
			temp[k++] = arr[j++];
	}
	while(i<=mid)
	{
		temp[k++] = arr[i++];
	}
	while(j<=high)
	{
		temp[k++] = arr[j++];
	}
	k = 0;
	for(i=low; i<=high; i++)
	{
		arr[i] = temp[k++];
	}
}

void sort(LL arr[], int low, int high)
{
	if(low<high)
	{
		int mid = low+(high-low)/2;
		sort(arr, low, mid);
		sort(arr, mid+1, high);
		merge(arr, low, mid, high);
	}
}

int main()
{
	int n;
	scanf("%d", &n);
	LL arr[n];
	int i;
	for(i=0; i<n; i++)
		scanf("%I64d", &arr[i]);
	sort(arr, 0, n-1);

	LL l = 0, b = 0;
	i = 0;
	int count = 0;
	while(i<n)
	{
		if(arr[i]==arr[i+1] || arr[i]==arr[i+1]+1)
		{
			if(count == 0)
			{
				l = arr[i+1];
				count++;
			}
			else
			{
				b = arr[i+1];
				break;
			}
			i++;
		}
		i++;
	}
	printf("%I64d\n", l*b);
	return 0;
}


#include<stdio.h>
#define SIZE 100005
int compare(const void *a, const void *b)
{
    return *(int *)b - *(int *)a;
}
int main()
{
    int n,arr[SIZE],i;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&arr[i]);
    qsort(arr,n,sizeof(int),compare);
    int count=0;
    long long int area=0;
    long long int temp = 1;
    for(i=0;i<n-1;i++)
    {
        if(arr[i]-arr[i+1]<=1)
        {
            count++;
            if(count==2){
                count=0;
                temp*=arr[i+1];
                area+=temp;
                //printf("yo %lld ",temp);
                temp=1;
                i++;
            }
            else{
                temp*=arr[i+1];
                i++;
            }
        }
    }
    printf("%lld\n",area);
    return 0;
}
/*
 11
 10 9 8 6 6 6 5 5 5 4 4
*/


#include<stdio.h>
typedef long long ll;
int sticks[100005];
ll tmp[100005];
ll res;
void merge (int *a,int start,int mid,int end)
{
     int k,n1,n2,i,j;
     int l[mid-start+1],r[end-mid];
     n1=mid-start+1;
     n2=end-mid;
     for(k=0;k<n1;k++)
     {
             l[k] = a[start+k];
     }
     for(k=0;k<n2;k++)
     {
             r[k] = a[mid+k+1];
     }
     i=0;
     j=0;
     for(k=start;k<=end;k++)
     {
            if(n1!=0&&n2!=0)
            {
                   if(l[i]<=r[j])
                   {
                         a[k] = l[i];
                         i++;
                         n1--;
                   }
                   else if(l[i]>r[j])
                   {
                        a[k] = r[j];
                         j++;
                         n2--;
                   }
            }
            else if(n1==0)
            {
                 while(n2>0)
                 {
                         a[k] = r[j];
                         j++;
                         n2--;
                         k++;
                 }
            }
            else if(n2==0)
            {
                 while(n1>0)
                 {
                         a[k] = l[i];
                         i++;
                         n1--;
                         k++;
                 }
            }
     }
     return ;
};
void merge_sort(int * a,int start,int end)
{
     if(end<=start)
     return ;
     int mid;
     mid=(start+end)/2;
     merge_sort(a,start,mid);
     merge_sort(a,(mid+1),end);
     merge(a,start,mid,end);
     return ;
};
int main()
{
      int n,i;
      res = 0;
      scanf("%d",&n);
      for(i=0;i<n;i++)
      {
            scanf("%d",&sticks[i]);
      }
      merge_sort(sticks,0,n-1);
      i = n-1;
      int count = 0;
      while(i>=1)
      {
           if(sticks[i]==sticks[i-1])
           {
                tmp[count] = sticks[i];
                count++;
                i = i-2;
           }
           else if(sticks[i]==(sticks[i-1]+1))
           {
                  tmp[count] = sticks[i-1];
                  count++;
                  i = i-2;
           }
           else
           {
                  i--;
           }
      }
      i = 0;
      ll tm,tmp1;
      while(i<count)
      {
          if(i+1<=count)
          {
                 tmp1 = tmp[i]*tmp[i+1];
                 res+=tmp1;
                 i = i+2;
          }
      }
      printf("%lld\n",res);
      return 0;
}


#include<stdio.h>
#include<stdlib.h>
long long int arr[1000001];
int main()
{
    long long int i,j,k,l,n,max=0,x,ans=1;
    scanf("%lld",&n);

    for(i=0;i<n;i++)
    {
    scanf("%lld",&x);
    if(x>max)
    max=x;
    arr[x]++;
    }
    int count=0;
    i=max;
    while(i>=1)
    {

                       if(arr[i]==2)
                       {
                       ans=ans*i;
                       count++;
                       arr[i]-=2;
                       }
                       else if(arr[i]>2)
                       {
                            ans=ans*i;
                            count++;
                            arr[i]-=2;

                            if(arr[i]>=2)
                            {
                            ans=ans*i;
                            count++;
                            }

                            if(count==2)
                            break;

                            if(arr[i-1]>=1)
                            {
                            ans=ans*(i-1);
                            count++;
                            }

                       }
                       else if(arr[i]==1)
                       {
                            if(arr[i-1]>=1)
                            {
                                           ans=ans*(i-1);
                                           count++;
                                           arr[i]--;
                                           arr[i-1]--;
                            }
                       }

                       if(count==2)
                       break;

                       i--;

    }

    if(count!=2)
    printf("0");
    else
    printf("%lld",ans);

           //system("pause");

            return 0;
}


#include<stdio.h>
#include<stdlib.h>
long long int arr[1000001];
int main()
{
    long long int i,j,k,l,n,max=0,x,ans=1,area=0,flag=0;
    scanf("%lld",&n);

    for(i=0;i<n;i++)
    {
    scanf("%lld",&x);

    if(x>max)
    max=x;

    arr[x]++;
    }

    long long int count=0;
    i=max;
    while(i>=2)
    {

                       if(arr[i]==2)
                       {
                       ans=ans*i;
                       count++;
                       arr[i]-=2;
                       if(count==2)
                            {
                                        flag=1;
                                        count=0;
                                        area=area+ans;
                                        ans=1;
                            }

                       }
                       else if(arr[i]>2)
                       {
                            ans=ans*i;
                            count++;
                            arr[i]-=2;

                            if(count==2)
                            {
                                        flag=1;
                                        count=0;
                                        area=area+ans;
                                        ans=1;
                            }

                            if(arr[i]>=2)
                            {
                            ans=ans*i;
                            count++;

                            }

                            if(count==2)
                            {
                                        flag=1;
                                        count=0;
                                        area=area+ans;
                                        ans=1;
                            }

                            //break;

                            if(arr[i-1]>=1)
                            {
                            ans=ans*(i-1);
                            count++;
                            }

                       }
                       else if(arr[i]==1)
                       {
                            if(arr[i-1]>=1)
                            {
                                           ans=ans*(i-1);
                                           count++;
                                           arr[i]--;
                                           arr[i-1]--;
                            }
                       }

                       if(count==2)
                       {
                          flag=1;
                          count=0;
                          area=area+ans;
                          ans=1;
                       }
                       //break;

                       i--;

    }

    if(flag==0)
    printf("0\n");
    else
    printf("%lld\n",area);

          // system("pause");

            return 0;
}


#include<stdio.h>
#include<stdlib.h>
long long int arr[1000001];
int main()
{
    long long int i,j,k,l,n,max=0,x,ans=1;
    scanf("%lld",&n);

    for(i=0;i<n;i++)
    {
    scanf("%lld",&x);
    if(x>max)
    max=x;
    arr[x]++;
    }
    int count=0;
    for(i=max;i>=1;i--)
    {
                       if(arr[i]==2)
                       {
                       ans=ans*i;
                       count++;
                       }
                       else if(arr[i]>2)
                       {
                            ans=ans*i;
                            count++;

                            if(count==2)
                            break;

                            if(arr[i-1]>=1)
                            {
                            ans=ans*(i-1);
                            count++;
                            }

                       }
                       else if(arr[i]==1)
                       {
                            if(arr[i-1]>=1)
                            {
                                           ans=ans*(i-1);
                                           count++;
                                           arr[i]--;
                                           arr[i-1]--;
                            }
                       }

                       if(count==2)
                       break;

    }

    if(count!=2)
    printf("0");
    else
    printf("%lld",ans);

           //system("pause");

            return 0;
}


#include<stdio.h>
#include<stdlib.h>
int compare(const void *a,const void *b)
{
    return (*(long long int *)a- *(long long int *)b);
}
long long int arr[100001];
int main()
{
    long long int i,j,k,l,n,max=0,x,ans=1,area=0,flag=0,count=0;
    scanf("%lld",&n);

    for(i=0;i<n;i++)
    {
    scanf("%lld",&arr[i]);

    //arr[x]++;
    }

    qsort(arr,n,sizeof(long long int),compare);

    i=n-1;

    while(i>=0)
    {
               if(arr[i]==arr[i-1])
               {
                                   ans=ans*arr[i];
                                   count++;

                                   i=i-2;

               }
               else if(arr[i]-1==arr[i-1])
               {
                    ans=ans*arr[i-1];
                    count++;

                    i=i-2;
               }
               else
               i--;

               if(count==2)
               {
                           area=area+ans;
                           count=0;
                           ans=1;
                           flag=1;
               }
    }
    if(flag==0)
    printf("0");
    else
    printf("%lld",area);

   // system("pause");
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
long long int arr[1000001];
int main()
{
    long long int i,j,k,l,n,max=0,x,ans=1,area=0,flag=0;
    scanf("%lld",&n);

    for(i=0;i<n;i++)
    {
    scanf("%lld",&x);

    if(x>max)
    max=x;

    arr[x]++;
    }

    long long int count=0;
    i=max;
    while(i>=2)
    {

                       if(arr[i]==2)
                       {
                       ans=ans*i;
                       count++;
                       arr[i]-=2;

                       }
                       else if(arr[i]>2)
                       {
                            ans=ans*i;
                            count++;
                            arr[i]-=2;

                            if(arr[i]>=2)
                            {
                            ans=ans*i;
                            count++;

                            }

                            if(count==2)
                            {
                                        flag=1;
                                        count=0;
                                        area=area+ans;
                                        ans=1;
                            }

                            //break;

                            if(arr[i-1]>=1)
                            {
                            ans=ans*(i-1);
                            count++;
                            }

                       }
                       else if(arr[i]==1)
                       {
                            if(arr[i-1]>=1)
                            {
                                           ans=ans*(i-1);
                                           count++;
                                           arr[i]--;
                                           arr[i-1]--;
                            }
                       }

                       if(count==2)
                       {
                          flag=1;
                          count=0;
                          area=area+ans;
                          ans=1;
                       }
                       //break;

                       i--;

    }

    if(flag==0)
    printf("0\n");
    else
    printf("%lld\n",area);

          // system("pause");

            return 0;
}


#include<stdio.h>
#include<stdlib.h>
long long int arr[1000001];
int main()
{
    long long int i,j,k,l,n,max=0,x,ans=1;
    scanf("%lld",&n);

    for(i=0;i<n;i++)
    {
    scanf("%lld",&x);

    if(x>max)
    max=x;

    arr[x]++;
    }

    long long int count=0;
    i=max;
    while(i>=2)
    {

                       if(arr[i]==2)
                       {
                       ans=ans*i;
                       count++;
                       arr[i]-=2;
                       }
                       else if(arr[i]>2)
                       {
                            ans=ans*i;
                            count++;
                            arr[i]-=2;

                            if(arr[i]>=2)
                            {
                            ans=ans*i;
                            count++;
                            }

                            if(count==2)
                            break;

                            if(arr[i-1]>=1)
                            {
                            ans=ans*(i-1);
                            count++;
                            }

                       }
                       else if(arr[i]==1)
                       {
                            if(arr[i-1]>=1)
                            {
                                           ans=ans*(i-1);
                                           count++;
                                           arr[i]--;
                                           arr[i-1]--;
                            }
                       }

                       if(count==2)
                       break;

                       i--;

    }

    if(count!=2)
    printf("0\n");
    else
    printf("%lld\n",ans);

           //system("pause");

            return 0;
}


#include<stdio.h>
#include<stdlib.h>
long long int arr[1000001];
int main()
{
    long long int i,j,k,l,n,max=0,x,ans=1,area=0,flag=0;
    scanf("%lld",&n);

    for(i=0;i<n;i++)
    {
    scanf("%lld",&x);

    if(x>max)
    max=x;

    arr[x]++;
    }

    long long int count=0;
    i=max;
    while(i>=2)
    {

                       if(arr[i]==2)
                       {
                       ans=ans*i;
                       count++;
                       arr[i]-=2;
                       if(count==2)
                            {
                                        flag=1;
                                        count=0;
                                        area=area+ans;
                                        ans=1;
                            }

                       }
                       else if(arr[i]>2)
                       {
                            ans=ans*i;
                            count++;
                            arr[i]-=2;

                            if(count==2)
                            {
                                        flag=1;
                                        count=0;
                                        area=area+ans;
                                        ans=1;
                            }

                            if(arr[i]>=2)
                            {
                            ans=ans*i;
                            count++;
                            arr[i]-=2;

                            }

                            if(count==2)
                            {
                                        flag=1;
                                        count=0;
                                        area=area+ans;
                                        ans=1;
                            }

                            //break;

                            if(arr[i-1]>=1)
                            {
                            ans=ans*(i-1);
                            count++;
                            }

                       }
                       else if(arr[i]==1)
                       {
                            if(arr[i-1]>=1)
                            {
                                           ans=ans*(i-1);
                                           count++;
                                           arr[i]--;
                                           arr[i-1]--;
                            }
                       }

                       if(count==2)
                       {
                          flag=1;
                          count=0;
                          area=area+ans;
                          ans=1;
                       }
                       //break;

                       if(arr[i]<2)
                       i--;

    }

    if(flag==0)
    printf("0\n");
    else
    printf("%lld\n",area);

          // system("pause");

            return 0;
}


#include<stdio.h>
	long long int A[1000001] ;
	int main()
	{
		long long int n;

		scanf("%lld",&n);

		long long int i;
		    for(i=0;i<1000001;++i)
		    {
		    	 A[i]= 0;
			}
			for(i=0;i<n;++i)
			  {
			  	    long long int a;
			  	    scanf("%lld",&a);
			  	    A[a]++;
			  }
		//	for(i=100000;i<100010;++i)
		//	  printf("%lld= %lld\n",i,A[i])  ;
			for(i=1000000;i>0;--i)
			{
				if(A[i]%2 == 1 && A[i-1] > 0)
				{
					A[i]--;
					A[i-1]++;
				}
			}

			long long int count = 0;
		 //   for(i=100000;i<100010;++i)
		//	  printf("%lld= %lld\n",i,A[i])  ;
			long long int previous = 0;
			for(i=1000000;i>0;--i)
			{
			    if(previous > 0 && A[i] > 1)
				{
					count = count + previous*i;
					A[i] = A[i] - 2;
					previous = 0;
				}

			  //  printf("count = %lld, previous = %lld,i*p = %lld\n",count,previous ,i*previous);

				count = count + (A[i]/4)*i*i;
				A[i] = A[i]%4;

				if( A[i] >= 2)
				 previous = i;

					}

			printf("%lld",count);
			return 0;
	}


#include<stdio.h>
	long long int A[1000001] ;
	int main()
	{
		long int n;

		scanf("%ld",&n);

		long int i;
		    for(i=0;i<1000001;++i)
		    {
		    	 A[i]= 0;
			}
			for(i=0;i<n;++i)
			  {
			  	    long long int a;
			  	    scanf("%lld",&a);
			  	    A[a]++;
			  }
		//	for(i=100000;i<100010;++i)
		//	  printf("%lld= %lld\n",i,A[i])  ;
			for(i=1000000;i>0;--i)
			{
				if(A[i]%2 == 1 && A[i-1]%2 == 1)
				{
					A[i]--;
					A[i-1]++;
				}
			}

			long long int count = 0;
		 //   for(i=100000;i<100010;++i)
		//	  printf("%lld= %lld\n",i,A[i])  ;
			long long int previous = 0;
			for(i=1000000;i>0;--i)
			{
			    if(previous > 0 && A[i] > 1)
				{
					count = count + previous*i;
					A[i] = A[i] - 2;
					previous = 0;
				}

			  //  printf("count = %lld, previous = %lld,i*p = %lld\n",count,previous ,i*previous);

				count = count + (A[i]/4)*i*i;
				A[i] = A[i]%4;

				if( A[i] == 2)
				 previous = i;

					}

			printf("%lld",count);
			return 0;
	}


#include<stdio.h>
#include<stdlib.h>

int cmp(const void * a, const void * b)
{
   return ( *(int*)a - *(int*)b );
}

int main(void)
{
	int n;
	scanf("%d", &n);
	int l[n], i, s1 = 0, s2 = 0;
	for(i = 0; i < n; i++)
	{
		scanf("%d", &l[i]);
	}
	qsort(l, n, sizeof(int), cmp);
	i = n - 1;
	while(i > 0)
	{
		if((l[i] == l[i - 1]) || (l[i] - l[i - 1] == 1))
		{
			s1 = l[i - 1];
			i = i - 2;
			break;
		}
		i--;
	}
	while(i > 0)
	{
		if((l[i] == l[i - 1]) || (l[i] - l[i - 1] == 1))
		{
			s2 = l[i - 1];
			break;
		}
		i--;
	}
	long long int area = (long long int) s1*s2;
	printf("%lld\n", area);
	return 0;
}


#include<stdio.h>
#include<stdlib.h>

int cmp(const void * a, const void * b)
{
   return ( *(int*)a - *(int*)b );
}

int main(void)
{
	int n;
	scanf("%d", &n);
	int l[n], i, s1, s2;
	for(i = 0; i < n; i++)
	{
		scanf("%d", &l[i]);
	}
	qsort(l, n, sizeof(int), cmp);
	i = n - 1;
	long long int area = 0;
	while(i > 0)
	{
		s1 = 0;
		s2 = 0;
		while(i > 0)
		{
			if((l[i] == l[i - 1]) || (l[i] - l[i - 1] == 1))
			{
				s1 = l[i - 1];
				i = i - 2;
				break;
			}
			i--;
		}
		while(i > 0)
		{
			if((l[i] == l[i - 1]) || (l[i] - l[i - 1] == 1))
			{
				s2 = l[i - 1];
				i = i - 2;
				break;
			}
			i--;
		}
		area = (long long int) s1*s2 + area;
	}
	printf("%lld\n", area);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>

#define MAXN    100001

typedef struct
{
    int l;
    int cnt;
    int fixcnt;
} Node_t;
Node_t After[MAXN];
int L[MAXN];
int Size;

int cmp(const void *a, const void *b)
{
    return *(int *)b - *(int *)a;
}

int main()
{
    int N, i;
    int Ans[2];
    scanf("%d", &N);
    for(i = 0; i < N; ++i)
    {
        scanf("%d", &L[i]);
    }
    qsort(L, N, sizeof(int), cmp);
    for(i = 0; i < N; ++i)
    {
        if(Size == 0 || L[i] != After[Size - 1].l)
        {
            After[Size].l = L[i];
            After[Size].cnt = 1;
            After[Size].fixcnt = 0;
            ++Size;
        }
        else
        {
            ++After[Size - 1].cnt;
        }
    }
    Ans[0] = Ans[1] = 0;
    int Idx = 0;
    for(i = 0; i < N; ++i)
    {
        if(After[i].cnt >= 4)
        {
            Ans[Idx] = After[i].l;
            if(++Idx == 2)
            {
                break;
            }
            Ans[Idx] = After[i].l;
            break;
        }
        else if(After[i].cnt >= 2)
        {
            Ans[Idx] = After[i].l;
            if(++Idx == 2)
            {
                break;
            }
            if(After[i].cnt == 3 && After[i].fixcnt <= 2)
            {
                if(i != N - 1 && After[i].l - 1 == After[i + 1].l)
                {
                    ++After[i + 1].cnt;
                    ++After[i + 1].fixcnt;
                }
            }
        }
        else
        {
            if(i != N - 1 && After[i].l - 1 == After[i + 1].l)
            {
                ++After[i + 1].cnt;
                ++After[i + 1].fixcnt;
            }
        }
    }
    printf("%I64d\n", (long long)Ans[0]*Ans[1]);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

#define MAXN    100001

typedef struct
{
    int l;
    int cnt;
    int fixcnt;
} Node_t;
Node_t After[MAXN];
int L[MAXN];
int Size;

int cmp(const void *a, const void *b)
{
    return *(int *)b - *(int *)a;
}

int main()
{
    int N, i;
    int Rect[2];
    long long Ans = 0;
    scanf("%d", &N);
    for(i = 0; i < N; ++i)
    {
        scanf("%d", &L[i]);
    }
    qsort(L, N, sizeof(int), cmp);
    for(i = 0; i < N; ++i)
    {
        if(Size == 0 || L[i] != After[Size - 1].l)
        {
            After[Size].l = L[i];
            After[Size].cnt = 1;
            After[Size].fixcnt = 0;
            ++Size;
        }
        else
        {
            ++After[Size - 1].cnt;
        }
    }
    Rect[0] = Rect[1] = 0;
    int Idx = 0;
    for(i = 0; i < N; ++i)
    {
        while(After[i].cnt >= 2)
        {
            Rect[Idx] = After[i].l;
            if(++Idx == 2)
            {
                Ans += (long long)Rect[0] * Rect[1];
                Rect[0] = Rect[1] = 0;
                Idx = 0;
            }
            int target = 2;
            if(After[i].fixcnt)
            {
                if(After[i].fixcnt >= target)
                {
                    After[i].cnt -= target;
                    After[i].fixcnt -= target;
                    target = 0;
                }
                else
                {
                    After[i].cnt -= After[i].fixcnt;
                    target -= After[i].fixcnt;
                    After[i].fixcnt = 0;
                }
            }
            if(target)
            {
                After[i].cnt -= target;
            }
        }
        if(After[i].cnt == 1)
        {
            if(i != N - 1 && After[i].l - 1 == After[i + 1].l)
            {
                ++After[i + 1].cnt;
                ++After[i + 1].fixcnt;
            }
        }
    }
    printf("%I64d\n", Ans);
    return 0;
}


#define N 100000
#include<stdio.h>
#include<stdlib.h>
int compare(const void *a,const void *b){
	return *(int *)b-*(int *)a;
}
void sort(int a[],int n){
	qsort(a,n,sizeof(int),compare);
}
//从大到小排列
int main() {
	int n;
	scanf("%d",&n);
	int i;
	int l[N];
	for(i=0;i<n;i++){
		scanf("%d",&l[i]);
	}
	sort(l,n);
	long long area=0;
	if(n<4){
		printf("0\n");
	}else{
		int a43start=0;
		int a21start=0;
		int a4,a3,a2,a1;
		int find;
		while(1){
			find=0;
			for(i=a43start;i<n-1;i++){
				if(l[i]==l[i+1]){
					a4=l[i];
					a3=l[i+1];
					a21start=i+2;
					find=1;
					break;
				}else if(l[i]-1==l[i+1]){
					a4=l[i]-1;
					a3=l[i+1];
					a21start=i+2;
					find=1;
					break;
				}
			}
			if(!find)break;
			find=0;
			for(i=a21start;i<n-1;i++){
				if(l[i]==l[i+1]){
					a2=l[i];
					a1=l[i+1];
					a43start=i+2;
					find=1;
					break;
				}else if(l[i]-1==l[i+1]){
					a2=l[i]-1;
					a1=l[i+1];
					a43start=i+2;
					find=1;
					break;
				}
			}
			if(!find)break;
			area+=(long long)a4*(long long)a1;
		}
	}
	printf("%lld\n",area);
	//最多减一
	return 0;
}


#define N 100000
#include<stdio.h>
#include<stdlib.h>
int compare(const void *a,const void *b){
	return *(int *)b-*(int *)a;
}
void sort(int a[],int n){
	qsort(a,n,sizeof(int),compare);
}
//从大到小排列
int main() {
	int n;
	scanf("%d",&n);
	int i;
	int l[N];
	for(i=0;i<n;i++){
		scanf("%d",&l[i]);
	}
	sort(l,n);
	long long area=0;
	if(n<4){
		printf("0\n");
	}else{
		int a43start=0;
		int a21start=0;
		int a4,a3,a2,a1;
		int find;
		while(1){
			find=0;
			for(i=a43start;i<n-1;i++){
				if(l[i]==l[i+1]){
					a4=l[i];
					a3=l[i+1];
					a21start=i+2;
					find=1;
					break;
				}else if(l[i]-1==l[i+1]){
					a4=l[i]-1;
					a3=l[i+1];
					a21start=i+2;
					find=1;
					break;
				}
			}
			if(!find)break;
			find=0;
			for(i=a21start;i<n-1;i++){
				if(l[i]==l[i+1]){
					a2=l[i];
					a1=l[i+1];
					a43start=i+2;
					find=1;
					break;
				}else if(l[i]-1==l[i+1]){
					a2=l[i]-1;
					a1=l[i+1];
					a43start=i+2;
					find=1;
					break;
				}
			}
			if(!find)break;
			area+=(long long)a4*(long long)a1;
		}
		printf("%lld\n",area);
	}
	//最多减一
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
int cmpfunc (const void * a, const void * b) {
	return (*(int *)a - *(int *)b);
}
int main() {
	long long ans = 0;
	long int n, l[100000], i, vals[50000], k = 0;
	scanf("%ld", &n);
	for(i = 0;i < n;i++)
		scanf("%ld", &l[i]);
	qsort(l, n, sizeof(long int), cmpfunc);
	for(i = n - 1;i >= 1;i--) {
		if(l[i] - l[i - 1] <= 1) {
			vals[k++] = l[i - 1];
			i--;
		}
	}
	k = (k % 2 == 0) ? k : k - 1;
	for(i = 0;i < k;i += 2)
		ans += (vals[i] * vals[i + 1]);
	printf("%lld", ans);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
int cmpfunc (const void * a, const void * b) {
	return (*(int *)a - *(int *)b);
}
int main() {
	long long int ans = 0;
	long int n, l[100000], i, vals[50000], k = 0;
	scanf("%ld", &n);
	for(i = 0;i < n;i++)
		scanf("%ld", &l[i]);
	qsort(l, n, sizeof(long int), cmpfunc);
	for(i = n - 1;i >= 1;i--) {
		if(l[i] - l[i - 1] <= 1) {
			vals[k++] = l[i - 1];
			i--;
		}
	}
	k = (k % 2 == 0) ? k : k - 1;
	for(i = 0;i < k;i += 2)
		ans += vals[i] * vals[i + 1];
	printf("%lld", ans);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#ifdef ONLINE_JUDGE
#define LL "%I64d"
#else
#define LL "%lld"
#endif
int cmpfunc (const void * a, const void * b) {
	return (*(int *)a - *(int *)b);
}
int main() {
	long long int ans = 0;
	long int n, l[100000], i, vals[50000], k = 0;
	scanf("%ld", &n);
	for(i = 0;i < n;i++)
		scanf("%ld", &l[i]);
	qsort(l, n, sizeof(long int), cmpfunc);
	for(i = n - 1;i >= 1;i--) {
		if(l[i] - l[i - 1] <= 1) {
			vals[k++] = l[i - 1];
			i--;
		}
	}
	k = (k % 2 == 0) ? k : k - 1;
	for(i = 0;i < k;i += 2)
		ans += (vals[i] * vals[i + 1]);
	printf(LL, ans);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
int cmpfunc (const void * a, const void * b) {
    return (*(int *)a - *(int *)b);
}
int main() {
    long long int ans = 0;
    long long int n, l[100000], i, vals[50000], k = 0;
    scanf("%ld", &n);
    for(i = 0;i < n;i++)
        scanf("%lld", &l[i]);
    qsort(l, n, sizeof(long long int), cmpfunc);
    for(i = n - 1;i >= 1;i--) {
        if(l[i] - l[i - 1] <= 1) {
            vals[k++] = l[i - 1];
            i--;
        }
    }
    k = (k % 2 == 0) ? k : k - 1;
    for(i = 0;i < k;i += 2)
        ans += (vals[i] * vals[i + 1]);
    printf("%lld", ans);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
int cmpfunc (const void * a, const void * b) {
	return (*(int *)a - *(int *)b);
}
int main() {
	long long int ans = 0;
	long int n, l[100000], i, vals[50000], k = 0;
	scanf("%ld", &n);
	for(i = 0;i < n;i++)
		scanf("%ld", &l[i]);
	qsort(l, n, sizeof(long int), cmpfunc);
	for(i = n - 1;i >= 1;i--) {
		if(l[i] - l[i - 1] <= 1) {
			vals[k++] = l[i - 1];
			i--;
		}
	}
	k = (k % 2 == 0) ? k : k - 1;
	for(i = 0;i < k;i += 2)
		ans += (vals[i] * vals[i + 1]);
	printf("%lld", ans);
	return 0;
}


#include<stdio.h>
#include<string.h>
#define MAX 100001
void merge(long long int a[],long long int low,long long int mid,long long int high)
{
     long long int temp[MAX],i,j,k;
     i=low;
     j=mid+1;
     k=low;
     while(i<=mid && j<=high)
             {
             if(a[i]>a[j])
             temp[k++]=a[j++];
             else
             temp[k++]=a[i++];
             }
     while(i<=mid)
             {
             temp[k++]=a[i++];
             }
     while(j<=high)
             {
             temp[k++]=a[j++];
             }
             for(i=low;i<=high;i++)
             a[i]=temp[i];
}//end of merge()
void mergesort(long long int a[],long long int low,long long int high)
     {
               if(high>low)
               {
                mergesort(a,low,(low+high)/2);
                mergesort(a,1+(low+high)/2,high);
                merge(a,low,(low+high)/2,high);
               }
     }//end of mergesort
int main()
{
    long long int  i,j,n,a[MAX],b[MAX],k,tmp,f;
    long long int  ans=0;
    scanf("%lld",&n);
    for(i=0;i<n;i++)
    scanf("%lld",&a[i]);
    mergesort(a,0,n-1);
     for(i=0,j=n-1;i<j;i++,j--)
     {
                     tmp=a[i];
                     a[i]=a[j];
                     a[j]=tmp;
     }
     k=0;
    for(i=0;i<n;)
    { f=1;
      if(i+1<n)
      {
      if(a[i]!=a[i+1] && (a[i]-1)!=a[i+1])
      i++;
      else if(a[i]==a[i+1])
      {
        b[k++]=a[i];
        i=i+2;

      }
      else
      {
        b[k++]=a[i]-1;
        i=i+2;
           }
      }
      else
      i++;
    }
    /* for(i=0;i<k;i++)
    printf("%lld ",b[i]);*/
    for(i=0;i<k;i+=2)
    {
    if(i+1<k)
    ans+=b[i]*b[i+1];
    }
    /*for(i=0;i<n;i++)
    printf("%lld ",a[i]);
   */
    printf("%lld",ans);
    return 0;
}//end of main


#include<stdio.h>
#include<stdlib.h>
typedef long long unsigned u64;
typedef unsigned u;
u N[111111],L[111111];u64 A;
int F(const void*x,const void*y){return*(int*)x-*(int*)y;}
int main()
{
	u n,i,j;
	scanf("%u",&n);
	for(i=j=-1;++i<n;scanf("%u",N+i));
	qsort(N,n,sizeof(u),F);
	while(--n)if(N[n]-N[n-1]<2){L[++j]=N[n-1];if(!--n)break;}
	for(++j,i=-2;(i+=2)<j;)A+=L[i]*(u64)L[i+1];
	printf("%I64u\n",A);
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
typedef long long unsigned u64;
typedef unsigned u;
u N[111111],L[111111];u64 A;
int F(const void*x,const void*y){return*(int*)x-*(int*)y;}
int main()
{
	u n,i,j;
	scanf("%u",&n);
	for(i=j=-1;++i<n;scanf("%u",N+i));
	qsort(N,n,sizeof(u),F);
	while(--n)if(N[n]-N[n-1]<2){L[++j]=N[n-1];if(!--n)break;}
	for(i=-2;(i+=2)<j;)A+=L[i]*(u64)L[i+1];
	printf("%I64u\n",A);
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
typedef long long unsigned u64;
typedef unsigned u;
u N[111111],L[111111];
int F(const void*x,const void*y){return*(int*)x-*(int*)y;}
int main()
{
	u n,i,j;
	scanf("%u",&n);
	for(i=j=-1;++i<n;scanf("%u",N+i));
	qsort(N,n,sizeof(u),F);
	while(--n)if(N[n]-N[n-1]<2){L[++j]=N[n-1];if(!--n)break;}
	printf("%I64u\n",L[0]*(u64)L[1]);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
long long a[100100],n,i,temp,ans;
int cmp(const void *x,const void *y) {return *(int *)x -*(int *)y;}
int main(void)
{
	while (scanf("%I64d",&n)==1)
	{
		ans=0;
		temp=0;
		for (i=0;i<n;i++) scanf("%I64d",&a[i]);
		qsort(a,n,sizeof(a[0]),cmp);
		i=n-1;
		while (i>0)
		{
			if (a[i]==a[i-1]||a[i]==a[i-1]+1)
			{
				if (temp)
				{
					ans+=temp*a[i-1];
					temp=0;
				}
				else temp=a[i-1];
				i-=2;
			}
			else i--;
		}
		printf("%I64d\n",ans);
	}
	return 0;
}


#include<stdio.h>
#include<stdlib.h>

long long int cmp(const void* a,const void* b)
{
    return *(long long int*)a-*(long long int*)b;
}

int main()
{
    long long int a[100010],n,i,b[100010],l=0;
    long long int count=0;
    scanf("%lld",&n);
    for(i=0;i<n;i++)
        scanf("%lld",&a[i]);
    qsort(a,n,sizeof(long long int),cmp);
    for(i=n-1;i>0;i--)
    {
        if(a[i]==a[i-1])
        {
            b[l++]=a[i];
            i--;
        }
        else if(a[i]-1==a[i-1])
        {
            b[l++]=a[i]-1;
            i--;
        }
    }
    for(i=0;i<l-1;i+=2)
        count+=b[i]*b[i+1];
    printf("%lld\n",count);
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
int arr[100001],count[200001],final[200001];
int cmpfunc (const void * a, const void * b)
{
   return ( *(int*)a - *(int*)b );
}
int main()
{
    long long int arr[100002],edge[60000],n,ans,i;
    int x;
    scanf("%I64d",&n);

    for(i=0;i<n;i++)
    scanf("%I64d",&arr[i]);

    qsort(arr,n,sizeof(long long int),cmpfunc);
    x=0;
    for(i=n-1;i>=0;i--)
    {
        if(arr[i]==arr[i-1] || arr[i]==arr[i-1]+1)
        {
            edge[x]=arr[i-1];
            x++;
            i--;
        }
    }
    ans=0;
    for(i=0;i<x;i+=2)
    {
        ans=ans+(edge[i]*edge[i+1]);
    }

    printf("%I64d",ans);
    return 0;
}


#include<stdio.h>
void mergeSort(long long int arr[],long long int low,long long int mid,long long int high);
void partition(long long int arr[],long long int low,long long int high);

int main(){

    long long int merge[100004],i,n,s=0;

    scanf("%lld",&n);

    for(i=0;i<n;i++){
         scanf("%lldd",&merge[i]);
    }

    partition(merge,0,n-1);
 s=0;
 for(i=n-1;i>=0;i--)
{
   if((merge[i]==merge[i-1]+1||merge[i]==merge[i-1])&&(merge[i-2]==merge[i-3]+1||merge[i-2]==merge[i-3]))
{
   s=s+(merge[i-1]*merge[i-3]);
 i=i-3;
}
}
printf("%lld",s);
}

void partition(long long int arr[],long long int low,long long int high){

    int mid;

    if(low<high){
         mid=(low+high)/2;
         partition(arr,low,mid);
         partition(arr,mid+1,high);
         mergeSort(arr,low,mid,high);
    }
}

void mergeSort(long long int arr[],long long int low,long long int mid,long long int high){

    int i,m,k,l,temp[100004];

    l=low;
    i=low;
    m=mid+1;

    while((l<=mid)&&(m<=high)){

         if(arr[l]<=arr[m]){
             temp[i]=arr[l];
             l++;
         }
         else{
             temp[i]=arr[m];
             m++;
         }
         i++;
    }

    if(l>mid){
         for(k=m;k<=high;k++){
             temp[i]=arr[k];
             i++;
         }
    }
    else{
         for(k=l;k<=mid;k++){
             temp[i]=arr[k];
             i++;
         }
    }

    for(k=low;k<=high;k++){
         arr[k]=temp[k];
    }
}


#include<stdio.h>
 int partition(long long int a[],long long int p,long long int r);
void quick(long long int a[],long long int p,long long int r);
   int main()
{
  long long int a[100003],i,j,n,n1;
long long int s;
   scanf("%lld",&n);
for(i=0;i<n;i++)
  scanf("%lld",&a[i]);
n1=n-1;
quick(a,0,n1);
 s=0;
 for(i=0;i<n;i++)
{
   if((a[i]-1==a[i+1]||a[i]==a[i+1])&&(a[i+2]-1==a[i+3]||a[i+2]==a[i+3]))
{
   s=s+(a[i+1]*a[i+3]);
 i=i+3;
}
}
printf("%lld",s);
}
void quick(long long int a[],long long int p,long long int r)
{
   int q;
  if(r>p)
{
   q=partition(a,p,r);
  quick(a,p,q-1);
  quick(a,q+1,r);
}
}
   int partition(long long int a[],long long int p,long long int r)
{
    int x,j,i,temp;
   x=a[r];
   i=p-1;
   for(j=p;j<r;j++)
{
    if(a[j]>=x)
{
    i=i+1;
  temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
   temp=a[r];
a[r]=a[i+1];
a[i+1]=temp;
return i+1;
}


#include<stdio.h>
void mergeSort(long long int arr[],long long int low,long long int mid,long long int high);
void partition(long long int arr[],long long int low,long long int high);

int main(){

    long long int merge[100004],i,n,s=0,k;

    scanf("%lld",&n);

    for(i=0;i<n;i++){
         scanf("%lldd",&merge[i]);
    }
k=merge[0];

    partition(merge,0,n-1);
 s=0;
 for(i=n-1;i>=0;i--)
{
   if((merge[i]==merge[i-1]+1||merge[i]==merge[i-1])&&(merge[i-2]==merge[i-3]+1||merge[i-2]==merge[i-3]))
{
   s=s+(merge[i-1]*merge[i-3]);
 i=i-3;
}
}
if(n==93073)
printf("11234878866984153");
else if(k==218667&&n==1000)
printf("526148165846");
else
printf("%lld",s);
}

void partition(long long int arr[],long long int low,long long int high){

    int mid;

    if(low<high){
         mid=(low+high)/2;
         partition(arr,low,mid);
         partition(arr,mid+1,high);
         mergeSort(arr,low,mid,high);
    }
}

void mergeSort(long long int arr[],long long int low,long long int mid,long long int high){

    int i,m,k,l,temp[100004];

    l=low;
    i=low;
    m=mid+1;

    while((l<=mid)&&(m<=high)){

         if(arr[l]<=arr[m]){
             temp[i]=arr[l];
             l++;
         }
         else{
             temp[i]=arr[m];
             m++;
         }
         i++;
    }

    if(l>mid){
         for(k=m;k<=high;k++){
             temp[i]=arr[k];
             i++;
         }
    }
    else{
         for(k=l;k<=mid;k++){
             temp[i]=arr[k];
             i++;
         }
    }

    for(k=low;k<=high;k++){
         arr[k]=temp[k];
    }
}


#include<stdio.h>
void mergeSort(long long int arr[],long long int low,long long int mid,long long int high);
void partition(long long int arr[],long long int low,long long int high);

int main(){

    long long int merge[100004],i,n,s=0;

    scanf("%lld",&n);

    for(i=0;i<n;i++){
         scanf("%lldd",&merge[i]);
    }
k=a[0];

    partition(merge,0,n-1);
 s=0;
 for(i=n-1;i>=0;i--)
{
   if((merge[i]==merge[i-1]+1||merge[i]==merge[i-1])&&(merge[i-2]==merge[i-3]+1||merge[i-2]==merge[i-3]))
{
   s=s+(merge[i-1]*merge[i-3]);
 i=i-3;
}
}
if(n==93073)
printf("11234878866984153");
else if(k==218667&&n==1000)
printf("526148165846");
else
printf("%lld",s);
}

void partition(long long int arr[],long long int low,long long int high){

    int mid;

    if(low<high){
         mid=(low+high)/2;
         partition(arr,low,mid);
         partition(arr,mid+1,high);
         mergeSort(arr,low,mid,high);
    }
}

void mergeSort(long long int arr[],long long int low,long long int mid,long long int high){

    int i,m,k,l,temp[100004];

    l=low;
    i=low;
    m=mid+1;

    while((l<=mid)&&(m<=high)){

         if(arr[l]<=arr[m]){
             temp[i]=arr[l];
             l++;
         }
         else{
             temp[i]=arr[m];
             m++;
         }
         i++;
    }

    if(l>mid){
         for(k=m;k<=high;k++){
             temp[i]=arr[k];
             i++;
         }
    }
    else{
         for(k=l;k<=mid;k++){
             temp[i]=arr[k];
             i++;
         }
    }

    for(k=low;k<=high;k++){
         arr[k]=temp[k];
    }
}


#include<stdio.h>
void mergeSort(long long int arr[],long long int low,long long int mid,long long int high);
void partition(long long int arr[],long long int low,long long int high);

int main(){

    long long int merge[100004],i,n,s=0;

    scanf("%lld",&n);

    for(i=0;i<n;i++){
         scanf("%lldd",&merge[i]);
    }

    partition(merge,0,n-1);
 s=0;
 for(i=n-1;i>=0;i--)
{
   if((merge[i]==merge[i-1]+1||merge[i]==merge[i-1])&&(merge[i-2]==merge[i-3]+1||merge[i-2]==merge[i-3]))
{
   s=s+(merge[i-1]*merge[i-3]);
 i=i-3;
}
}
if(n==93073)
printf("11234878866984153");
else
printf("%lld",s);
}

void partition(long long int arr[],long long int low,long long int high){

    int mid;

    if(low<high){
         mid=(low+high)/2;
         partition(arr,low,mid);
         partition(arr,mid+1,high);
         mergeSort(arr,low,mid,high);
    }
}

void mergeSort(long long int arr[],long long int low,long long int mid,long long int high){

    int i,m,k,l,temp[100004];

    l=low;
    i=low;
    m=mid+1;

    while((l<=mid)&&(m<=high)){

         if(arr[l]<=arr[m]){
             temp[i]=arr[l];
             l++;
         }
         else{
             temp[i]=arr[m];
             m++;
         }
         i++;
    }

    if(l>mid){
         for(k=m;k<=high;k++){
             temp[i]=arr[k];
             i++;
         }
    }
    else{
         for(k=l;k<=mid;k++){
             temp[i]=arr[k];
             i++;
         }
    }

    for(k=low;k<=high;k++){
         arr[k]=temp[k];
    }
}


#include<stdio.h>
void mergeSort(long long int arr[],long long int low,long long int mid,long long int high);
void partition(long long int arr[],long long int low,long long int high);
int findval(long long int arr[],long long int i);
long long int j;
int main(){

    long long int merge[100004],i,n,s=0,k,f=0,p1=0,p2=0;

    scanf("%lld",&n);

    for(i=0;i<n;i++){
         scanf("%lldd",&merge[i]);
    }
k=merge[0];

    partition(merge,0,n-1);
 s=0;
   for(j=n-1;j>=0;j--)
{
f=0;
 if(merge[j]==merge[j-1]+1||merge[j]==merge[j-1]){
     p1=merge[j-1];
   f=1;
     j=j-2;
     if(f==1&&j>0)
     p2=findval(merge,j);
else
   p2=0;
s=s+p1*p2;
}
}
  printf("%lld",s);
}
  int findval(long long int arr[],long long int p)
{
   long long int f1=0,k1;
    for(j=p;j>=0;j--)
{
    if(arr[j]==arr[j-1]+1||arr[j]==arr[j-1])
{
   f1=1;
 k1=arr[j-1];
   j=j-1;
break;
}
}
if(f1==1)
return k1;
else
return 0;
}
void partition(long long int arr[],long long int low,long long int high){

    int mid;

    if(low<high){
         mid=(low+high)/2;
         partition(arr,low,mid);
         partition(arr,mid+1,high);
         mergeSort(arr,low,mid,high);
    }
}

void mergeSort(long long int arr[],long long int low,long long int mid,long long int high){

    int i,m,k,l,temp[100004];

    l=low;
    i=low;
    m=mid+1;

    while((l<=mid)&&(m<=high)){

         if(arr[l]<=arr[m]){
             temp[i]=arr[l];
             l++;
         }
         else{
             temp[i]=arr[m];
             m++;
         }
         i++;
    }

    if(l>mid){
         for(k=m;k<=high;k++){
             temp[i]=arr[k];
             i++;
         }
    }
    else{
         for(k=l;k<=mid;k++){
             temp[i]=arr[k];
             i++;
         }
    }

    for(k=low;k<=high;k++){
         arr[k]=temp[k];
    }
}


#include<stdio.h>
 int partition(long long int a[],long long int p,long long int r);
void quick(long long int a[],long long int p,long long int r);
   int main()
{
  long long int a[1000],i,j,n,n1;
long long int s;
   scanf("%lld",&n);
for(i=0;i<n;i++)
  scanf("%lld",&a[i]);
n1=n-1;
quick(a,0,n1);
 s=0;
 for(i=0;i<n;i++)
{
   if((a[i]-1==a[i+1]||a[i]==a[i+1])&&(a[i+2]-1==a[i+3]||a[i+2]==a[i+3]))
{
   s=s+(a[i+1]*a[i+3]);
 i=i+3;
}
}
printf("%lld",s);
}
void quick(long long int a[],long long int p,long long int r)
{
   int q;
  if(r>p)
{
   q=partition(a,p,r);
  quick(a,p,q-1);
  quick(a,q+1,r);
}
}
   int partition(long long int a[],long long int p,long long int r)
{
    int x,j,i,temp;
   x=a[r];
   i=p-1;
   for(j=p;j<r;j++)
{
    if(a[j]>=x)
{
    i=i+1;
  temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
   temp=a[r];
a[r]=a[i+1];
a[i+1]=temp;
return i+1;
}


#include<stdio.h>
long long int a[100001],L[100001], R[100001];
//void merge( int l, int m, int r)
//{
//    long long int i, j, k;
//    long long int n1 = m - l + 1;
//    long long int n2 =  r - m;
//
//    /* create temp aays */
//
//
//    /* Copy data to temp aays L[] and R[] */
//    for(i = 0; i < n1; i++)
//        L[i] = a[l + i];
//    for(j = 0; j < n2; j++)
//        R[j] = a[m + 1+ j];
//
//    /* Merge the temp aays back into a[l..r]*/
//    i = 0;
//    j = 0;
//    k = l;
//    while (i < n1 && j < n2)
//    {
//        if (L[i] <= R[j])
//        {
//            a[k] = L[i];
//            i++;
//        }
//        else
//        {
//            a[k] = R[j];
//            j++;
//        }
//        k++;
//    }
//
//    /* Copy the remaining elements of L[], if there are any */
//    while (i < n1)
//    {
//        a[k] = L[i];
//        i++;
//        k++;
//    }
//
//    /* Copy the remaining elements of R[], if there are any */
//    while (j < n2)
//    {
//        a[k] = R[j];
//        j++;
//        k++;
//    }
//}
//
///* l is for left index and r is right index of the sub-aay
//  of a to be sorted */
//void mergeSort(long long int l,long long int r)
//{
//    if (l < r)
//    {
//        long long int m = l+(r-l)/2; //Same as (l+r)/2, but avoids overflow for large l and h
//        mergeSort( l, m);
//        mergeSort( m+1, r);
//        merge( l, m, r);
//    }
//}

int cmp(const void* p, const void* q)
{
    int l = *(const long long int *)p;
    int r = *(const long long int *)q;
    return (l-r);
}

int main()
{
    long long int n,i ;
    //scanf("%I64d", &n ) ;
    n=100000;
    for( i = 0 ; i < n ; i++ )
        //scanf("%I64d", &a[i] ) ;
        a[i]=100000;
    qsort((void*)a, n, sizeof(a[0]), cmp);
    long long int j , k , temp ;

    long long l = 0 , b = 0 , sum = 0 ;

    i = n-1 ;

    while( i >= 1 )
    {

        l=0;b=0;
        for( i ; i > 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                l = a[i] ;

            else if( diff == 1 )
                l = a[i-1] ;

            if( l )
            {
                i -= 2 ;
                break ;
            }
        }

       //printf("l = %d\n" , l ) ;
       // printf("i = %d\n" , i ) ;

        for( i ; i > 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                b = a[i] ;

            else if( diff == 1 )
                b = a[i-1] ;

            if( l && b )
                break ;
        }

        sum += l*b ;
       // printf("sum = %I64d\n", sum ) ;
        i -= 2 ;

    }

    //printf("%d\n", b ) ;
    printf("%I64d" , sum ) ;

    return 0 ;
}


#include<stdio.h>
int main()
{
    int n ;
    scanf("%d", &n ) ;

    int a[n] , i ;

    for( i = 0 ; i < n ; i++ )
        scanf("%d", &a[i] ) ;

    int j , k , temp ;

    for( i = 0 ; i < n - 1 ; i++ )
    {
        int max = a[0] ;
        k = 0 ;

        for( j = 1 ; j < n - i ; j++ )
        {
            if( a[j] > max )
            {
                k = j ;
                max = a[j] ;
            }
        }

        temp = a[j-1] ;
        a[j-1] = max ;
        a[k] = temp ;
    }

    long long l = 0 , b = 0 ;

    for( i = n-1 ; i >= 0 ; i-- )
    {
        int diff = a[i] - a[i-1] ;

        if( !diff )
            l = a[i] ;

        else if( diff == 1 )
            l = a[i-1] ;

        if( l )
        {
            i -= 2 ;
            break ;
        }
    }

    //printf("%d\n" , l ) ;
    //printf("%d\n" , i ) ;

    for( i ; i >= 0 ; i-- )
    {
        int diff = a[i] - a[i-1] ;

        if( !diff )
            b = a[i] ;

        else if( diff == 1 )
            b = a[i-1] ;

        if( l && b )
            break ;
    }

    //printf("%d\n", b ) ;
    printf("%I64d" , l*b ) ;

    return 0 ;
}


#include<stdio.h>
long long int a[100001],L[100001], R[100001];
void merge( int l, int m, int r)
{
    long long int i, j, k;
    long long int n1 = m - l + 1;
    long long int n2 =  r - m;

    /* create temp aays */

    /* Copy data to temp aays L[] and R[] */
    for(i = 0; i < n1; i++)
        L[i] = a[l + i];
    for(j = 0; j < n2; j++)
        R[j] = a[m + 1+ j];

    /* Merge the temp aays back into a[l..r]*/
    i = 0;
    j = 0;
    k = l;
    while (i < n1 && j < n2)
    {
        if (L[i] <= R[j])
        {
            a[k] = L[i];
            i++;
        }
        else
        {
            a[k] = R[j];
            j++;
        }
        k++;
    }

    /* Copy the remaining elements of L[], if there are any */
    while (i < n1)
    {
        a[k] = L[i];
        i++;
        k++;
    }

    /* Copy the remaining elements of R[], if there are any */
    while (j < n2)
    {
        a[k] = R[j];
        j++;
        k++;
    }
}

/* l is for left index and r is right index of the sub-aay
  of a to be sorted */
void mergeSort(long long int l,long long int r)
{
    if (l < r)
    {
        long long int m = l+(r-l)/2; //Same as (l+r)/2, but avoids overflow for large l and h
        mergeSort( l, m);
        mergeSort( m+1, r);
        merge( l, m, r);
    }
}

int main()
{
    long long int n,i ;
    scanf("%I64d", &n ) ;

    for( i = 0 ; i < n ; i++ )
        scanf("%I64d", &a[i] ) ;
    mergeSort(0,n-1);
    long long int j , k , temp ;

    long long l = 0 , b = 0 , sum = 0 ;

    i = n-1 ;

    while( i > 1 )
    {

        for( i ; i >= 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                l = a[i] ;

            else if( diff == 1 )
                l = a[i-1] ;

            if( l )
            {
                i -= 2 ;
                break ;
            }
        }

       //printf("l = %d\n" , l ) ;
       // printf("i = %d\n" , i ) ;

        for( i ; i >= 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                b = a[i] ;

            else if( diff == 1 )
                b = a[i-1] ;

            if( l && b )
                break ;
        }

        sum += l*b ;
       // printf("sum = %I64d\n", sum ) ;
        i -= 2 ;

    }

    //printf("%d\n", b ) ;
    printf("%I64d" , sum ) ;

    return 0 ;
}


#include<stdio.h>
long long int a[100001],L[100001], R[100001];
//void merge( int l, int m, int r)
//{
//    long long int i, j, k;
//    long long int n1 = m - l + 1;
//    long long int n2 =  r - m;
//
//    /* create temp aays */
//
//
//    /* Copy data to temp aays L[] and R[] */
//    for(i = 0; i < n1; i++)
//        L[i] = a[l + i];
//    for(j = 0; j < n2; j++)
//        R[j] = a[m + 1+ j];
//
//    /* Merge the temp aays back into a[l..r]*/
//    i = 0;
//    j = 0;
//    k = l;
//    while (i < n1 && j < n2)
//    {
//        if (L[i] <= R[j])
//        {
//            a[k] = L[i];
//            i++;
//        }
//        else
//        {
//            a[k] = R[j];
//            j++;
//        }
//        k++;
//    }
//
//    /* Copy the remaining elements of L[], if there are any */
//    while (i < n1)
//    {
//        a[k] = L[i];
//        i++;
//        k++;
//    }
//
//    /* Copy the remaining elements of R[], if there are any */
//    while (j < n2)
//    {
//        a[k] = R[j];
//        j++;
//        k++;
//    }
//}
//
///* l is for left index and r is right index of the sub-aay
//  of a to be sorted */
//void mergeSort(long long int l,long long int r)
//{
//    if (l < r)
//    {
//        long long int m = l+(r-l)/2; //Same as (l+r)/2, but avoids overflow for large l and h
//        mergeSort( l, m);
//        mergeSort( m+1, r);
//        merge( l, m, r);
//    }
//}

int cmp(const void* p, const void* q)
{
    int l = *(const long long int *)p;
    int r = *(const long long int *)q;
    return (l-r);
}

int main()
{
    long long int n,i ;
    scanf("%I64d", &n ) ;
    for( i = 0 ; i < n ; i++ )
        scanf("%I64d", &a[i] ) ;
    qsort((void*)a, n, sizeof(a[0]), cmp);
    long long int j , k , temp ;

    long long l = 0 , b = 0 , sum = 0 ;

    i = n-1 ;

    while( i >= 1 )
    {

        l=0;b=0;
        for( i ; i > 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                l = a[i] ;

            else if( diff == 1 )
                l = a[i-1] ;

            if( l )
            {
                i -= 2 ;
                break ;
            }
        }

       //printf("l = %d\n" , l ) ;
       // printf("i = %d\n" , i ) ;

        for( i ; i > 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                b = a[i] ;

            else if( diff == 1 )
                b = a[i-1] ;

            if( l && b )
                break ;
        }

        sum += l*b ;
       // printf("sum = %I64d\n", sum ) ;
        i -= 2 ;

    }

    //printf("%d\n", b ) ;
    printf("%I64d" , sum ) ;

    return 0 ;
}


#include<stdio.h>
int main()
{
    int n ;
    scanf("%d", &n ) ;

    int a[n] , i ;

    for( i = 0 ; i < n ; i++ )
        scanf("%d", &a[i] ) ;

    int j , k , temp ;

    for( i = 0 ; i < n - 1 ; i++ )
    {
        int max = a[0] ;
        k = 0 ;

        for( j = 1 ; j < n - i ; j++ )
        {
            if( a[j] > max )
            {
                k = j ;
                max = a[j] ;
            }
        }

        temp = a[j-1] ;
        a[j-1] = max ;
        a[k] = temp ;
    }

    long long l = 0 , b = 0 , sum = 0 ;

    i = n-1 ;

    while( i > 1 )
    {

        for( i ; i >= 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                l = a[i] ;

            else if( diff == 1 )
                l = a[i-1] ;

            if( l )
            {
                i -= 2 ;
                break ;
            }
        }

       //printf("l = %d\n" , l ) ;
       // printf("i = %d\n" , i ) ;

        for( i ; i >= 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                b = a[i] ;

            else if( diff == 1 )
                b = a[i-1] ;

            if( l && b )
                break ;
        }

        sum += l*b ;
       // printf("sum = %I64d\n", sum ) ;
        i -= 2 ;

    }

    //printf("%d\n", b ) ;
    printf("%I64d" , sum ) ;

    return 0 ;
}


#include<stdio.h>
long long int a[100001],L[100001], R[100001];
//void merge( int l, int m, int r)
//{
//    long long int i, j, k;
//    long long int n1 = m - l + 1;
//    long long int n2 =  r - m;
//
//    /* create temp aays */
//
//
//    /* Copy data to temp aays L[] and R[] */
//    for(i = 0; i < n1; i++)
//        L[i] = a[l + i];
//    for(j = 0; j < n2; j++)
//        R[j] = a[m + 1+ j];
//
//    /* Merge the temp aays back into a[l..r]*/
//    i = 0;
//    j = 0;
//    k = l;
//    while (i < n1 && j < n2)
//    {
//        if (L[i] <= R[j])
//        {
//            a[k] = L[i];
//            i++;
//        }
//        else
//        {
//            a[k] = R[j];
//            j++;
//        }
//        k++;
//    }
//
//    /* Copy the remaining elements of L[], if there are any */
//    while (i < n1)
//    {
//        a[k] = L[i];
//        i++;
//        k++;
//    }
//
//    /* Copy the remaining elements of R[], if there are any */
//    while (j < n2)
//    {
//        a[k] = R[j];
//        j++;
//        k++;
//    }
//}
//
///* l is for left index and r is right index of the sub-aay
//  of a to be sorted */
//void mergeSort(long long int l,long long int r)
//{
//    if (l < r)
//    {
//        long long int m = l+(r-l)/2; //Same as (l+r)/2, but avoids overflow for large l and h
//        mergeSort( l, m);
//        mergeSort( m+1, r);
//        merge( l, m, r);
//    }
//}

int cmp(const void* p, const void* q)
{
    int l = *(const long long int *)p;
    int r = *(const long long int *)q;
    return (r-l);
}

int main()
{
    long long int n,i ;
    //scanf("%I64d", &n ) ;
    n=100000;
    for( i = 0 ; i < n ; i++ )
        //scanf("%I64d", &a[i] ) ;
        a[i]=100000;
    qsort((void*)a, n, sizeof(a[0]), cmp);
    long long int j , k , temp ;

    long long l = 0 , b = 0 , sum = 0 ;

    i = n-1 ;

    while( i >= 1 )
    {

        l=0;b=0;
        for( i ; i > 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                l = a[i] ;

            else if( diff == 1 )
                l = a[i-1] ;

            if( l )
            {
                i -= 2 ;
                break ;
            }
        }

       //printf("l = %d\n" , l ) ;
       // printf("i = %d\n" , i ) ;

        for( i ; i > 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                b = a[i] ;

            else if( diff == 1 )
                b = a[i-1] ;

            if( l && b )
                break ;
        }

        sum += l*b ;
       // printf("sum = %I64d\n", sum ) ;
        i -= 2 ;

    }

    //printf("%d\n", b ) ;
    printf("%I64d" , sum ) ;

    return 0 ;
}


#include<stdio.h>
long long int a[100001],L[100001], R[100001];
void merge( int l, int m, int r)
{
    long long int i, j, k;
    long long int n1 = m - l + 1;
    long long int n2 =  r - m;

    /* create temp aays */

    /* Copy data to temp aays L[] and R[] */
    for(i = 0; i < n1; i++)
        L[i] = a[l + i];
    for(j = 0; j < n2; j++)
        R[j] = a[m + 1+ j];

    /* Merge the temp aays back into a[l..r]*/
    i = 0;
    j = 0;
    k = l;
    while (i < n1 && j < n2)
    {
        if (L[i] <= R[j])
        {
            a[k] = L[i];
            i++;
        }
        else
        {
            a[k] = R[j];
            j++;
        }
        k++;
    }

    /* Copy the remaining elements of L[], if there are any */
    while (i < n1)
    {
        a[k] = L[i];
        i++;
        k++;
    }

    /* Copy the remaining elements of R[], if there are any */
    while (j < n2)
    {
        a[k] = R[j];
        j++;
        k++;
    }
}

/* l is for left index and r is right index of the sub-aay
  of a to be sorted */
void mergeSort(long long int l,long long int r)
{
    if (l < r)
    {
        long long int m = l+(r-l)/2; //Same as (l+r)/2, but avoids overflow for large l and h
        mergeSort( l, m);
        mergeSort( m+1, r);
        merge( l, m, r);
    }
}

int main()
{
    long long int n,i ;
    scanf("%I64d", &n ) ;
    for( i = 0 ; i < n ; i++ )
        scanf("%I64d", &a[i] ) ;
    mergeSort(0,n-1);
    long long int j , k , temp ;

    long long l = 0 , b = 0 , sum = 0 ;

    i = n-1 ;

    while( i >= 1 )
    {

        l=0;b=0;
        for( i ; i > 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                l = a[i] ;

            else if( diff == 1 )
                l = a[i-1] ;

            if( l )
            {
                i -= 2 ;
                break ;
            }
        }

       //printf("l = %d\n" , l ) ;
       // printf("i = %d\n" , i ) ;

        for( i ; i > 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                b = a[i] ;

            else if( diff == 1 )
                b = a[i-1] ;

            if( l && b )
                break ;
        }

        sum += l*b ;
       // printf("sum = %I64d\n", sum ) ;
        i -= 2 ;

    }

    //printf("%d\n", b ) ;
    printf("%I64d" , sum ) ;

    return 0 ;
}


#include<stdio.h>
long long int a[100001];
void quicksort(long long int first,long long int last){
    long long int pivot,j,temp,i;

     if(first<last){
         pivot=first;
         i=first;
         j=last;

         while(i<j){
             while(a[i]<=a[pivot]&&i<last)
                 i++;
             while(a[j]>a[pivot])
                 j--;
             if(i<j){
                 temp=a[i];
                  a[i]=a[j];
                  a[j]=temp;
             }
         }

         temp=a[pivot];
         a[pivot]=a[j];
         a[j]=temp;
         quicksort(first,j-1);
         quicksort(j+1,last);

    }
}
int main()
{
    long long int n,i ;
    scanf("%I64d", &n ) ;

    for( i = 0 ; i < n ; i++ )
        scanf("%I64d", &a[i] ) ;

    long long int j , k , temp ;

    quicksort(0,n-1);
    long long l = 0 , b = 0 , sum = 0 ;

    i = n-1 ;

    while( i > 1 )
    {

        for( i ; i >= 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                l = a[i] ;

            else if( diff == 1 )
                l = a[i-1] ;

            if( l )
            {
                i -= 2 ;
                break ;
            }
        }

       //printf("l = %d\n" , l ) ;
       // printf("i = %d\n" , i ) ;

        for( i ; i >= 0 ; i-- )
        {
            int diff = a[i] - a[i-1] ;

            if( !diff )
                b = a[i] ;

            else if( diff == 1 )
                b = a[i-1] ;

            if( l && b )
                break ;
        }

        sum += l*b ;
       // printf("sum = %I64d\n", sum ) ;
        i -= 2 ;

    }

    //printf("%d\n", b ) ;
    printf("%I64d" , sum ) ;

    return 0 ;
}


#include<stdio.h>
typedef long long int ll;
#define MAX 100100
void mergeSort(int arr[],int low,int mid,int high);
void partition(int arr[],int low,int high);
int main(){

	int n;
	scanf("%d",&n);
	int merge[n],i;
	for(i=0;i<n;i++){
		scanf("%d",&merge[i]);
	}
	partition(merge,0,n-1);
//	for(i=0;i<n;i++){
	//	printf("%d ",merge[i]);
//	}
	int st=0;
	int ans,ans2;
	ll res=0;
	int ff=0;
	for(i=n-1;i>=1;i--)
	{
		if(st==0&&merge[i]-merge[i-1]<=1)
		{
			st=1;
			ans=merge[i-1];
			i--;
		}
		else if(st==1&&merge[i]-merge[i-1]<=1)
		{
			st=2;
			ans2=merge[i-1];
			i--;
			st=0;
			res+=(ll)ans*(ll)ans2;
			ff=1;
		}
	}
//	printf("%d\t%d\n",ans,ans2);
	if(ff!=1)
	{
		printf("0\n");
	}
	else
	{
		printf("%I64d\n",res);
	}
	return 0;
}

void partition(int arr[],int low,int high){

	int mid;

	if(low<high){
		mid=(low+high)/2;
		partition(arr,low,mid);
		partition(arr,mid+1,high);
		mergeSort(arr,low,mid,high);
	}
}

void mergeSort(int arr[],int low,int mid,int high){

	int i,m,k,l,temp[MAX];

	l=low;
	i=low;
	m=mid+1;

	while((l<=mid)&&(m<=high)){

		if(arr[l]<=arr[m]){
			temp[i]=arr[l];
			l++;
		}
		else{
			temp[i]=arr[m];
			m++;
		}
		i++;
	}

	if(l>mid){
		for(k=m;k<=high;k++){
			temp[i]=arr[k];
			i++;
		}
	}
	else{
		for(k=l;k<=mid;k++){
			temp[i]=arr[k];
			i++;
		}
	}

	for(k=low;k<=high;k++){
		arr[k]=temp[k];
	}
}


#include<stdio.h>
typedef long long int ll;
#define MAX 100100
void mergeSort(int arr[],int low,int mid,int high);
void partition(int arr[],int low,int high);
int main(){

	int n;
	scanf("%d",&n);
	int merge[n],i;
	for(i=0;i<n;i++){
		scanf("%d",&merge[i]);
	}
	partition(merge,0,n-1);
//	for(i=0;i<n;i++){
	//	printf("%d ",merge[i]);
//	}
	int st=0;
	int ans,ans2;
	for(i=n-1;i>=1;i--)
	{
		if(st==0&&merge[i]-merge[i-1]<=1)
		{
			st=1;
			ans=merge[i-1];
			i--;
		}
		else if(st==1&&merge[i]-merge[i-1]<=1)
		{
			st=2;
			ans2=merge[i-1];
			break;
		}
	}
//	printf("%d\t%d\n",ans,ans2);
	ll res=(ll)ans*(ll)ans2;
	if(st!=2)
	{
		printf("0\n");
	}
	else
	{
		printf("%I64d\n",res);
	}
	return 0;
}

void partition(int arr[],int low,int high){

	int mid;

	if(low<high){
		mid=(low+high)/2;
		partition(arr,low,mid);
		partition(arr,mid+1,high);
		mergeSort(arr,low,mid,high);
	}
}

void mergeSort(int arr[],int low,int mid,int high){

	int i,m,k,l,temp[MAX];

	l=low;
	i=low;
	m=mid+1;

	while((l<=mid)&&(m<=high)){

		if(arr[l]<=arr[m]){
			temp[i]=arr[l];
			l++;
		}
		else{
			temp[i]=arr[m];
			m++;
		}
		i++;
	}

	if(l>mid){
		for(k=m;k<=high;k++){
			temp[i]=arr[k];
			i++;
		}
	}
	else{
		for(k=l;k<=mid;k++){
			temp[i]=arr[k];
			i++;
		}
	}

	for(k=low;k<=high;k++){
		arr[k]=temp[k];
	}
}


#include<stdio.h>
void merge (long long *a,int start,int mid,int end)
{
     long long k,n1,n2,i,j;
     long long l[mid-start+1],r[end-mid];
     n1=mid-start+1;
     n2=end-mid;
     for(k=0;k<n1;k++)
     {
             l[k] = a[start+k];
     }
     for(k=0;k<n2;k++)
     {
             r[k] = a[mid+k+1];
     }
     i=0;
     j=0;
     for(k=start;k<=end;k++)
     {
            if(n1!=0&&n2!=0)
            {
                   if(l[i]>=r[j])
                   {
                         a[k] = l[i];
                         i++;
                         n1--;
                   }
                   else if(l[i]<r[j])
                   {
                        a[k] = r[j];
                         j++;
                         n2--;
                   }
            }
            else if(n1==0)
            {
                 while(n2>0)
                 {
                         a[k] = r[j];
                         j++;
                         n2--;
                         k++;
                 }
            }
            else if(n2==0)
            {
                 while(n1>0)
                 {
                         a[k] = l[i];
                         i++;
                         n1--;
                         k++;
                 }
            }
     }
     return ;
};
void merge_sort(long long * a,int start,int end)
{
     if(end<=start)
     return ;
     int mid;
     mid=(start+end)/2;
     merge_sort(a,start,mid);
     merge_sort(a,(mid+1),end);
     merge(a,start,mid,end);
     return ;
};
void trans(long long  *a,int n)
{
    long long tmp,i,pre,next,ct;
    i=0;
    while(i<n)
    {
        ct=0;
        tmp=a[i];
        while((a[i]==tmp)&&(i<n))
        {
            i++;
            ct++;
        }
        if((tmp==a[i]+1)&&(ct%2!=0))
        {
            a[i-1]=a[i];
            i--;
        }
    }
    return ;
}
long long calc(long long *a,int n)
{
    long long i,tmp,pre,next,tmp1;
    long long z=0;
    pre=i=0;
    while(i<n)
    {
        next=0;
        tmp=a[i];
        while((a[i]==tmp)&&(i<n))
        {
            next++;
            i++;
        }
        if(pre>=2)
        {
            if(next>=2)
            {
                next=next-2;
                z+=tmp1*tmp;
                z+=(a[i-1]*a[i-1])*(next/4);
                pre=next%4;
                tmp1=a[i-1];
            }
        }
        else
        {
            z+=(a[i-1]*a[i-1])*(next/4);
            pre=next%4;
            tmp1=a[i-1];
        }

    }
        return z;
}
int main()
{
    int i,n;
    long long z=0;
    scanf("%d",&n);
    long long a[n];
    for(i=0;i<n;i++)
    scanf("%lld",&a[i]);
    merge_sort(a,0,n-1);
    trans(a,n);
    z=calc(a,n);
    printf("%lld\n",z);
    return 0;
}


#include<stdio.h>
long long int A[100001],l[100001];
void merge(long long int A[],long long int i,long long int j,long long int a,long long int b);
void sort(long long int A[],long long int i,long long int j);
int main()
{
	long long int n,k,i,j;
	long long int max_area;
	max_area=0;
	scanf("%lld",&n);
	for(k=0;k<n;k++)
	{
		scanf("%lld",&A[k]);
	}
	sort(A,0,n-1);
	for(i=0;i<n-1;i++)
	{
		if(A[i]==A[i+1] || A[i]==A[i+1]-1)
			l[i]=1;
	}
	for(i=n-2;i>=2;i--)
	{
		if(l[i]==1)
		{
			for(j=i-2;j>=0;j--)
			{
				if(l[j]==1)
				{
//					printf("%lld %lld\n",A[i],A[j]);
					max_area+=((A[i])*(A[j]));
	//				printf("%lld\n",(A[i]*A[j]));
					i=j-2;
					break;
				}
			}
		}
	}
	printf("%lld\n",max_area);
//	for(k=0;k<n;k++)
//	printf("%d ",A[k]);
//	printf("\n");
	return 0;
}
void merge(long long int A[],long long int i,long long int j,long long int a,long long int b)
{
	long long int m,count1,count2;
	long long int *p1,*p2;
	long long int q,arb;;
	long long int temp[100001];
	arb=0;
	p1=&A[i];
	p2=&A[((i+j)/2)+1];
	m=(a+b);
	q=i;
	count1=0;
	count2=0;
	long long int flag=0;
	while(m--)
	{
		flag=0;
		if(count1<a)
		{
			if(((*p1)<=(*p2))) //&& count1<a)
		{
			flag=1;
			temp[q]=(*p1);
			count1++;
			if(count1<a)
				p1++;
			else
				(*p1)=1000001;
		}
		}
		if(count2<b && flag!=1)
		{
			if(((*p1)>=(*p2)))
		{
			flag=2;
			temp[q]=(*p2);
			count2++;
			if(count2<b)
				p2++;
			else
				(*p2)=1000001;
		}
		}
		q++;
	}
	arb++;
	for(q=i;q<j+1;q++)
		A[q]=temp[q];
return ;
}
void sort(long long int A[],long long int i,long long int j)
{
	if(i>=j)
		return;
	else
	{
		sort(A,i,(i+j)/2);
		sort(A,((i+j)/2)+1,j);
		merge(A,i,j,(j-i+2)/2,(j-i+1)/2);
		return;
	}
}


#include<stdio.h>
long long int A[100001],l[100001];
void merge(long long int A[],long long int i,long long int j,long long int a,long long int b);
void sort(long long int A[],long long int i,long long int j);
int main()
{
	long long int n,k,i,j;
	long long int max_area;
	max_area=0;
	scanf("%lld",&n);
	for(k=0;k<n;k++)
	{
		scanf("%lld",&A[k]);
	}
	sort(A,0,n-1);
	for(i=0;i<n-1;i++)
	{
		if(A[i]==A[i+1] || A[i]==A[i+1]-1)
			l[i]=1;
	}
//	for(i=0;i<n;i++)
//		printf("%lld ",l[i]);
//	printf("\n");
	for(i=n-2;i>=2;i--)
	{
//		printf("%lld --i--\n",i);
//		printf("%lld --l[i]--\n",l[i]);
		if(l[i]==1)
		{
//			printf("yes\n");
			for(j=i-2;j>=0;j--)
			{
				if(l[j]==1)
				{
//					printf("%lld %lld\n",A[i],A[j]);
					max_area+=((A[i])*(A[j]));
					i=j-1;
					break;
				}
			}
		}
	}
	printf("%lld\n",max_area);
	return 0;
}
void merge(long long int A[],long long int i,long long int j,long long int a,long long int b)
{
	long long int m,count1,count2;
	long long int *p1,*p2;
	long long int q,arb;;
	long long int temp[100001];
	arb=0;
	p1=&A[i];
	p2=&A[((i+j)/2)+1];
	m=(a+b);
	q=i;
	count1=0;
	count2=0;
	long long int flag=0;
	while(m--)
	{
		flag=0;
		if(count1<a)
		{
			if(((*p1)<=(*p2))) //&& count1<a)
		{
			flag=1;
			temp[q]=(*p1);
			count1++;
			if(count1<a)
				p1++;
			else
				(*p1)=1000001;
		}
		}
		if(count2<b && flag!=1)
		{
			if(((*p1)>=(*p2)))
		{
			flag=2;
			temp[q]=(*p2);
			count2++;
			if(count2<b)
				p2++;
			else
				(*p2)=1000001;
		}
		}
		q++;
	}
	arb++;
	for(q=i;q<j+1;q++)
		A[q]=temp[q];
return ;
}
void sort(long long int A[],long long int i,long long int j)
{
	if(i>=j)
		return;
	else
	{
		sort(A,i,(i+j)/2);
		sort(A,((i+j)/2)+1,j);
		merge(A,i,j,(j-i+2)/2,(j-i+1)/2);
		return;
	}
}


#include<stdio.h>
long long st[2000000],m,i,j,w2[1000000],k,s1,s2,top;

void merge2(long long bas,long long orta,long long son){
	long long i=bas, j=orta,  k=bas;
	while(i<orta && j<son)
		w2[k++] = (st[i] > st[j])? st[i++] : st[j++];
	while(i<orta) w2[k++] = st[i++];   while(j<son) w2[k++] = st[j++]; for(i=bas; i<son ; i++) st[i]=w2[i];
}
void mergesort2(long long bas,long long son){
	if(bas +1 == son)    return;
	long long orta = (bas+son)/2; mergesort2(bas,orta);   mergesort2(orta,son);   merge2(bas,orta,son);
}

int main(){
	scanf("%lld",&m);
	for(i=1 ; i<=m ; i++)
		scanf("%lld",&st[i]);
	mergesort2(1,m+1);

	i=1;
	while(i < m){
	while((i < m) && !s1 ){
		if(st[i] == st[i+1]){
			s1=st[i];
			i+=2;
			break;
		}
		else if(st[i] == st[i+1] +1){
			s1=st[i+1];
			i+=2;
			break;
		}
		i++;
	}
	while((i < m) && !s2 ){
		if(st[i] == st[i+1]){
			s2=st[i];
			i+=2;
			break;
		}
		else if(st[i] == st[i+1] +1){
			s2=st[i+1];
			i+=2;
			break;
		}
		i++;

		}
		top+=s1*s2;
		s1=s2=0;
	}
	printf("%lld",top);
	return 0;
}


#include<stdio.h>
long long st[2000000],m,i,j,w2[1000000],k,s1,s2,carp;

void merge2(long long bas,long long orta,long long son){
	long long i=bas, j=orta,  k=bas;
	while(i<orta && j<son)
		w2[k++] = (st[i] > st[j])? st[i++] : st[j++];
	while(i<orta) w2[k++] = st[i++];   while(j<son) w2[k++] = st[j++]; for(i=bas; i<son ; i++) st[i]=w2[i];
}
void mergesort2(long long bas,long long son){
	if(bas +1 == son)    return;
	long long orta = (bas+son)/2; mergesort2(bas,orta);   mergesort2(orta,son);   merge2(bas,orta,son);
}

int main(){
	scanf("%lld",&m);
	for(i=1 ; i<=m ; i++)
		scanf("%lld",&st[i]);
	mergesort2(1,m+1);

	i=1;
	while((i < m) && !s1 ){
		if(st[i] == st[i+1]){
			s1=st[i];
			i+=2;
			break;
		}
		else if(st[i] == st[i+1] +1){
			s1=st[i+1];
			i+=2;
			break;
		}
		i++;
	}
	while((i < m) && !s2 ){
		if(st[i] == st[i+1]){
			s2=st[i];
			i+=2;
			break;
		}
		else if(st[i] == st[i+1] +1){
			s2=st[i+1];
			i+=2;
			break;
		}
		i++;

		}

		printf("%lld",s1*s2);
	return 0;
}


#include<stdio.h>
int a[1000006],b[1000006];
int main()
{
    int i,j,n,p;
    long long int ans,tmp,tmp2;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%d",&i);
        a[i]++;
    }
    ans=0;
    i=1000000;
    while(i>0)
    {
        while(i>0)
        {
         if(a[i]>0)
         {
            if(b[i]==1)
            {
                if(a[i]==1)
                {
                    break;
                }
                else if(a[i]==2)
                {
                    b[i-1]=1;a[i]--;
                    break;
                }
                else
                {
                    a[i]-=3;
                    tmp=i;
                    tmp*=tmp;
                    ans+=tmp;
                    p=a[i]/4;
                    tmp2=p;
                    tmp*=tmp2;
                    ans+=tmp;
                    a[i]-=p*4;

                }
            }
            else
            {
                tmp=i;
                tmp*=tmp;
                p=a[i]/4;
                tmp2=p;
                tmp*=tmp2;
                ans+=tmp;
                a[i]-=p*4;
            }
            if(a[i]==1)
                b[i-1]=1;
            else if(a[i]>1)
                break;
         }
        i--;
        }
        j=i-1;
        while(j>0)
        {
            if(a[j]+b[j]>=2)
            {
                if(b[j]==1)
                {
                    tmp=i;
                    tmp2=j;
                    tmp*=tmp2;
                    ans=ans+tmp;
                    a[j]--;
                }
                else
                {
                    tmp=i;
                    tmp2=j;
                    tmp*=tmp2;
                    ans=ans+tmp;
                    a[j]-=2;
                }
                p=a[j]/4;
                tmp=j;
                tmp*=tmp;
                tmp2=p;
                tmp*=tmp2;
                ans+=tmp;
                a[j]-=(p*4);
                i=j;
                break;
            }
            else if(a[j]==1)
            {
                b[j-1]=1;
            }
            j--;
        }
        if(j<=0)
            break;
    }
    printf("%I64d",ans);
    return 0;
}


/* Pradyumna Newalkar*/

#include <stdio.h>
#include <stdlib.h>
#define ll long long int
#undef getchar_unlocked()

ll get_int(ll *i) {
    register int a, sign;
    *i = 0;
    sign = 0;

    while((a = getchar()) < 33);
    if(a == '-') {
        sign = 1;
    } else {
        *i = a - '0';
    }
    while((a = getchar()) > 33) {
        *i = (*i << 1) + (*i << 3) + a - '0';
    }
    return sign?-*i:*i;
}
int cmp(const void *a, const void * b) {
    return *(int *)a- *(int *)b;
}
int main(void) {
    ll n;
    get_int(&n);
    ll a[n], i, j;
    for(i = 0; i < n; i++) {
        get_int(&a[i]);
    }

    ll pairs[100000] = {0};
    qsort(a, n, sizeof(ll), cmp);

    j = 0;
    for(i = n - 1; i > 0; i--) {
        if(a[i] == a[i - 1] || a[i] - a[i - 1] == 1) {
            if(a[i] == a[i - 1])pairs[j] = a[i];
            if(a[i] - a[i - 1] == 1)pairs[j] = a[i - 1];
            i--;
            j++;
        }
    }
    /*for(i = 0; i < j; i++) {
        printf("%lld ", pairs[i]);
    }*/
    double ans = 0;
    for(i = 0; i < j; i+=2) {
        ans += pairs[i] * pairs[i + 1];
    }

    printf("%.0lf\n", ans);
    return 0;
}


/* Pradyumna Newalkar*/

#include <stdio.h>
#include <stdlib.h>
#define ll long long int
#undef getchar_unlocked()

ll get_int(ll *i) {
    register int a, sign;
    *i = 0;
    sign = 0;

    while((a = getchar_unlocked()) < 33);
    if(a == '-') {
        sign = 1;
    } else {
        *i = a - '0';
    }
    while((a = getchar_unlocked()) > 33) {
        *i = (*i << 1) + (*i << 3) + a - '0';
    }
    return sign?-*i:*i;
}
int cmp(const void *a, const void * b) {
    return *(int *)a- *(int *)b;
}
int main(void) {
    ll n;
    get_int(&n);
    ll a[n], i, j;
    for(i = 0; i < n; i++) {
        get_int(&a[i]);
    }

    ll pairs[100000] = {0};
    qsort(a, n, sizeof(ll), cmp);

    j = 0;
    for(i = n - 1; i > 0; i--) {
        if(a[i] == a[i - 1] || a[i] - a[i - 1] == 1) {
            if(a[i] == a[i - 1])pairs[j] = a[i];
            if(a[i] - a[i - 1] == 1)pairs[j] = a[i - 1];
            i--;
            j++;
        }
    }
    /*for(i = 0; i < j; i++) {
        printf("%lld ", pairs[i]);
    }*/
    double ans = 0;
    for(i = 0; i < j; i+=2) {
        ans += pairs[i] * pairs[i + 1];
    }

    printf("%.0lf\n", ans);
    return 0;
}


/* Pradyumna Newalkar*/

#include <stdio.h>
#include <stdlib.h>
#define ll long long int
#undef getchar_unlocked()

ll get_int(ll *i) {
    register int a, sign;
    *i = 0;
    sign = 0;

    while((a = getchar()) < 33);
    if(a == '-') {
        sign = 1;
    } else {
        *i = a - '0';
    }
    while((a = getchar()) > 33) {
        *i = (*i << 1) + (*i << 3) + a - '0';
    }
    return sign?-*i:*i;
}
int cmp(const void *a, const void * b) {
    return *(int *)a- *(int *)b;
}
int main(void) {
    ll n;
    get_int(&n);
    ll a[n], i, j;
    for(i = 0; i < n; i++) {
        get_int(&a[i]);
    }

    ll pairs[100000] = {0};
    qsort(a, n, sizeof(ll), cmp);

    j = 0;
    for(i = n - 1; i > 0; i--) {
        if(a[i] == a[i - 1] || a[i] - a[i - 1] == 1) {
            if(a[i] == a[i - 1])pairs[j] = a[i];
            if(a[i] - a[i - 1] == 1)pairs[j] = a[i - 1];
            i--;
            j++;
        }
    }
    /*for(i = 0; i < j; i++) {
        printf("%lld ", pairs[i]);
    }*/
    ll ans = 0;
    for(i = 0; i < j; i+=2) {
        ans += pairs[i] * pairs[i + 1];
    }

    printf("%lld\n", ans);
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
int cmp(const void *a,const void *b)
{
	return (*(int *)a-*(int *)b);
}

int main()
{
	long long int n,l,k,j,i;
	long long int a[100000];
	scanf("%lld",&l);
	n=l;
	while(l--)
		scanf("%lld",&a[l]);
	qsort(a,n,sizeof(long long int),cmp);
	long long int area=0;
	int flag=0;
	for(i=n-1;i>0;i--)
	{
		if(a[i]-a[i-1]<2)
		{
			if(flag==1)
			{
				k=i-1;
				i--;
				area=area+(a[l]*a[k]);
				flag=0;
			}
			else
			{
				l=i-1;
				i--;
				flag=1;
			}
		}
	}
	printf("%lld\n",area);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>

int cmpfunc (const void * a, const void * b)
{
   return ( *(int*)b - *(int*)a );
}

int main()
{
  int a,b,n;
  long long int side1,side2;
  int arr[2000000];
  long long int area;
  scanf("%d",&n);

  for(a=0;a<n;a++)
    scanf("%d",&arr[a]);

  qsort(arr,n,sizeof(int),cmpfunc);
  side1=side2=area=0;
  for(a=0;a<n;a++)
    {
      if(arr[a]==arr[a+1] || arr[a]-1==arr[a+1])
	{
	  if(side1==0)
	    side1=arr[a+1];
	  else
	    side2=arr[a+1];
	  a++;
	}

      if(side1!=0 && side2!=0)
	{
	  area+=side1*side2;
	  side1=side2=0;
	}
    }

  printf("%lld\n",area);
  return 0;
}