#include <bits/stdc++.h>
using namespace std;
char alphz[27] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                  'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                  's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
float Euclidean(long long x1, long long x2, long long y1, long long y2) {
  return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
}
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long LCM(long long a, long long b) { return (a * b) / gcd(a, b); }
void PrimeFactor(long long n) {
  while (n % 2 == 0) {
    n /= 2;
  }
  for (int i = 3; i <= sqrt(n); i += 2) {
    if (n % i == 0) {
      n /= i;
    }
  }
  if (n > 2) {
  };
}
bool is_square(long long x) {
  long long l = 0, r = x;
  while (l <= r) {
    long long mid = l + (r - l) / 2;
    if (mid * mid == x) return true;
    if (mid * mid > x)
      r = mid - 1;
    else
      l = mid + 1;
  }
  return false;
}
long long power(long long x, long long y) {
  long long temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else
    return x * temp * temp;
}
bool is_Prime(int x) {
  if (x == 2)
    return 1;
  else if (x % 2 == 0 || x < 2)
    return 0;
  for (int i = 3; i * i <= x; i += 2)
    if (x % i == 0) return 0;
  return 1;
}
const int N = 1e+5;
int aseg[N], seg[N * 4];
void SEGBuild(int pos, int low, int hig) {
  if (low == hig)
    seg[pos] = aseg[low];
  else {
    int mid = low + (hig - low) / 2;
    SEGBuild(2 * pos, low, mid);
    SEGBuild(2 * pos + 1, mid + 1, hig);
    if (seg[2 * pos] < seg[2 * pos + 1])
      seg[pos] = seg[2 * pos];
    else
      seg[pos] = seg[2 * pos + 1];
  }
}
void SEGUpdate(int pos, int idx, int low, int hig, int val) {
  if (low == hig) {
    aseg[idx] = val;
    seg[pos] = val;
  } else {
    int mid = low + (hig - low) / 2;
    if (idx >= low && idx <= mid)
      SEGUpdate(2 * pos, idx, low, mid, val);
    else
      SEGUpdate(2 * pos + 1, idx, mid + 1, hig, val);
    seg[pos] = min(seg[2 * pos + 1], seg[2 * pos]);
  }
}
int ANSQuery(int pos, int low, int hig, int l, int r) {
  if (l > hig || low > r) return 1e+5;
  if (l <= low && r >= hig)
    return seg[pos];
  else {
    int p1, p2;
    int mid = low + (hig - low) / 2;
    p1 = ANSQuery(2 * pos, low, mid, l, r);
    p2 = ANSQuery(2 * pos + 1, mid + 1, hig, l, r);
    return min(p1, p2);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<long long> a(n), b;
  long long ans = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end(), greater<long long>());
  for (int i = 0; i < n - 1; i++) {
    if (a[i] - a[i + 1] <= 1) b.push_back(a[i + 1]), i++;
  }
  for (int i = 0; i < (int)b.size() - 1; i += 2) {
    ans += b[i] * b[i + 1];
  }
  cout << ans << '\n';
  return 0;
}
