#include <bits/stdc++.h>
using namespace std;
vector<long long> a, b;
int main() {
  long long n, v;
  cin >> n;
  while (n--) {
    cin >> v;
    a.push_back(v);
  }
  sort(a.begin(), a.end());
  for (int i = (int)a.size() - 1; i >= 0; i--) {
    if (a[i] == a[i - 1] || a[i] - 1 == a[i - 1]) {
      b.push_back(min(a[i], a[i - 1]));
      i--;
    }
  }
  long long ans = 0;
  for (int i = 0; i < b.size(); i += 2) {
    if (i + 1 < b.size()) {
      ans += b[i] * b[i + 1];
    }
  }
  cout << ans << endl;
  return 0;
}
