#include <bits/stdc++.h>
using namespace std;
void scanint(int &x) {
  register int c = getchar();
  x = 0;
  for (; (c < 48 || c > 57); c = getchar())
    ;
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
}
void scanll(long long &x) {
  register long long c = getchar();
  x = 0;
  for (; (c < 48 || c > 57); c = getchar())
    ;
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
}
long long modpow(long long a, long long b) {
  long long x = 1ll, y = a;
  while (b) {
    if (b % 2) x = (x * y);
    y = (y * y);
    b /= 2;
  }
  return x;
}
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
int cnt[1001000];
int main() {
  memset(cnt, 0, sizeof(cnt));
  ;
  int n, i, j;
  long long ma, w, h, nrect, p, lval, lcnt;
  ma = 0;
  scanint(n);
  long long arr[n];
  for (i = 0; i < n; i++) {
    scanll(arr[i]);
    cnt[arr[i]]++;
  }
  sort(arr, arr + n);
  lcnt = 0;
  for (i = n - 1; i >= 0; i--) {
    if (lcnt > 0 && cnt[arr[i]] >= 2) {
      cnt[arr[i]] -= 2;
      ma += (arr[i] * lval);
      lcnt = 0;
    }
    nrect = cnt[arr[i]] / 4;
    p = modpow(arr[i], 2);
    ma += p * nrect;
    cnt[arr[i]] %= 4;
    if (cnt[arr[i]] >= 2) {
      lval = arr[i];
      lcnt = 1;
    }
    cnt[arr[i]] %= 2;
    if (cnt[arr[i]] == 1 && i > 0) {
      if (arr[i] - arr[i - 1] == 1) cnt[arr[i - 1]]++;
    }
  }
  cout << ma << endl;
  return 0;
}
