#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.rbegin(), v.rend());
  vector<int> sides;
  for (int i = 0; i < n - 1; i++) {
    if (v[i] == v[i + 1]) {
      sides.push_back(v[i]);
      i++;
    } else if (v[i] - 1 == v[i + 1]) {
      sides.push_back(v[i] - 1);
      i++;
    }
  }
  long long area = 0;
  for (int i = 1; i < sides.size(); i += 2) {
    area += (long long)sides[i] * (long long)sides[i - 1];
  }
  cout << area << endl;
  return 0;
}
