#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int DX[] = {1, 0, -1, 0}, DY[] = {0, 1, 0, -1};
long long int C(int n, int k) {
  long long ans = 1;
  k = k > n - k ? n - k : k;
  int j = 1;
  for (; j <= k; j++, n--) {
    if (n % j == 0) {
      ans *= n / j;
    } else if (ans % j == 0) {
      ans = ans / j * n;
    } else {
      ans = (ans * n) / j;
    }
  }
  return ans;
}
long long int powmod(long long int a, long long int b) {
  long long int res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0)
    return (b);
  else
    return (gcd(b % a, a));
}
long long int powmod(long long int a, long long int b, long long int m) {
  long long int res = 1;
  a %= m;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  vector<long long int> stick(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> stick[i];
  }
  long long int ans = 0;
  sort((stick).begin(), (stick).end());
  long long int a, c;
  int flag = 0;
  for (int i = stick.size() - 1; i >= 1; i--) {
    if (stick[i] - stick[i - 1] <= 1) {
      if (flag == 0) {
        a = stick[i - 1];
        i--;
        flag = 1;
      } else if (flag == 1) {
        c = stick[i - 1];
        ans += a * c;
        flag = 0;
        i--;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
