#include <bits/stdc++.h>
using namespace std;
const int maxk = 1000005;
int cnt[maxk];
long long a[maxk];
int asz = 0;
int main() {
  cin.sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    ++cnt[x];
  }
  for (int i = maxk - 1; i > 0; --i) {
    for (int j = 0; j < cnt[i] / 2; ++j) a[asz++] = i;
    if ((cnt[i] & 1) && cnt[i - 1]) {
      --cnt[i - 1];
      a[asz++] = i - 1;
    }
  }
  long long ans = 0;
  for (int i = 1; i < asz; i += 2) ans += a[i] * a[i - 1];
  cout << ans << endl;
  42;
  return 0;
}
