#include <bits/stdc++.h>
using namespace std;
int dX[] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dY[] = {0, 1, 0, -1, 1, 1, -1, -1};
inline void Refresh() {}
long long int len[1000007];
vector<long long int> sticks;
int main() {
  int n;
  long long int ans = 0;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> len[i];
  }
  sort(len + 1, len + n + 1);
  long long int lastlen = -1;
  for (int i = n; i > 0; --i) {
    if (lastlen == -1) {
      lastlen = len[i];
      continue;
    }
    if (abs(len[i] - lastlen) <= 1) {
      sticks.push_back(min(len[i], lastlen));
      lastlen = -1;
    } else
      lastlen = len[i];
  }
  reverse(sticks.begin(), sticks.end());
  for (int i = sticks.size() - 1; i >= 1; i -= 2) {
    ans += sticks[i] * sticks[i - 1];
  }
  cout << ans << endl;
  return 0;
}
