#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main(int argv, char** argc) {
  int n;
  cin >> n;
  long long sticks[n];
  for (long long i = 0; i < n; i++) {
    cin >> sticks[i];
  }
  sort(sticks, sticks + n);
  reverse(sticks, sticks + n);
  int s1 = -1;
  long long total = 0;
  for (long long i = 0; i < n - 1; i++) {
    if (s1 == -1) {
      if (sticks[i] - sticks[i + 1] <= 1) {
        s1 = i;
        i++;
      }
    } else {
      if (sticks[i] - sticks[i + 1] <= 1) {
        total +=
            min(sticks[i], sticks[i + 1]) * min(sticks[s1], sticks[s1 + 1]);
        s1 = -1;
        i++;
      }
    }
  }
  cout << total << endl;
  return 0;
}
