#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long> vect;
  sort(a, a + n);
  for (long long i = n - 1; i >= 0;) {
    if (i - 1 >= 0) {
      if (a[i - 1] == a[i] or a[i - 1] + 1 == a[i]) {
        vect.push_back(a[i - 1]);
        i = i - 2;
      } else {
        i--;
      }
    } else {
      i--;
    }
  }
  long long ans = 0;
  for (long long i = 0; i < vect.size(); i += 2) {
    if (i + 1 < vect.size()) {
      ans += (vect[i] * vect[i + 1]);
    }
  }
  cout << ans << '\n';
  return 0;
}
