#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> v(1000001, 0), w(1000001, 0);
  int k;
  for (int i = 0; i < n; i++) {
    cin >> k;
    v[k]++;
  }
  for (int i = 1000000; i > 0; i--) {
    if ((v[i] + w[i]) % 2 == 1) {
      if (v[i] > 0) {
        w[i - 1]++;
        v[i]--;
      }
    }
  }
  for (int i = 1000000; i >= 0; i--) v[i] += w[i];
  long long ans = 0, cur;
  bool prev = false;
  for (long long i = 1000001; i > 0; i--) {
    if (!prev) {
      if (v[i] >= 4) {
        ans += (v[i] / 4) * i * i;
        v[i] %= 4;
      }
      if (v[i] >= 2) {
        prev = true;
        cur = i;
      }
    } else {
      if (v[i] >= 2) {
        ans += cur * i;
        v[i] -= 2;
        prev = false;
      }
      if (v[i] >= 4) {
        ans += (v[i] / 4) * i * i;
        v[i] %= 4;
      }
      if (v[i] >= 2) {
        prev = true;
        cur = i;
      }
    }
  }
  cout << ans;
  return 0;
}
