#include <bits/stdc++.h>
using namespace std;
vector<long long> stick;
int main() {
  long long n;
  cin >> n;
  stick.resize(n);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    stick[i] = a;
  }
  sort(stick.begin(), stick.end());
  for (int i = n - 1; i >= 3; i--) {
    if (stick[i] - stick[i - 1] <= 1) {
      int j = i - 2;
      while (stick[j] - stick[j - 1] > 1 && j >= 1) j--;
      if (stick[j] - stick[j - 1] <= 1 && j >= 1)
        ans = ans + stick[i - 1] * stick[j - 1];
      i = j - 1;
    }
  }
  cout << ans;
  return 0;
}
