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