#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ans = 0;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.rbegin(), a.rend());
  if (a.size() < 4) {
    cout << 0;
    return 0;
  }
  long long l = -1;
  for (long long i = 0; i < a.size(); i++) {
    if (l == -1 &&
        (a[i] == a[i + 1] || (a[i] > a[i + 1] && a[i] - a[i + 1] == 1))) {
      l = i + 1;
      i++;
      continue;
    }
    if (l != -1 &&
        (a[i] == a[i + 1] || (a[i] > a[i + 1] && a[i] - a[i + 1] == 1))) {
      ans += a[l] * a[i + 1];
      l = -1;
      i++;
      continue;
    }
  }
  cout << ans;
  return 0;
}
