#include <bits/stdc++.h>
const int OO = 1e9;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = (0); i < (int)(n); ++i) {
    cin >> a[i];
  }
  sort(((a).begin()), ((a).end()));
  unsigned long long res = 0;
  vector<unsigned long long> v;
  for (int i = n - 1; i > 0; i--) {
    if (a[i] == a[i - 1]) {
      v.push_back(a[i]);
      v.push_back(a[i]);
      i--;
    } else if (a[i] == a[i - 1] + 1) {
      v.push_back(a[i - 1]);
      v.push_back(a[i - 1]);
      i--;
    }
  }
  if (v.size() < 4)
    cout << 0 << endl;
  else {
    for (int i = 0; i < v.size() - 3; i += 4)
      res += (unsigned long long)v[i] * (unsigned long long)v[i + 2];
    cout << res;
  }
  return 0;
}
