#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d\n", &n);
  vector<int> ind(n, 0);
  int tmp;
  for (int i = 0; i < n; i++) {
    scanf("%d", &tmp);
    ind[i] = tmp;
  }
  sort(ind.begin(), ind.end());
  int len = ind.size();
  vector<pair<int, int> > lenAndCount;
  int tmpVal;
  int tmpCount;
  for (int i = len - 1; i >= 0;) {
    tmpVal = ind[i];
    tmpCount = 0;
    while (i >= 0 && tmpVal == ind[i]) {
      tmpCount++;
      i--;
    }
    lenAndCount.push_back(make_pair(tmpVal, tmpCount));
  }
  vector<pair<int, int> > newLenAndCount;
  for (int i = 0; i < lenAndCount.size(); i++) {
    if (lenAndCount[i].second % 2 == 0) {
      lenAndCount[i].second /= 2;
      newLenAndCount.push_back(lenAndCount[i]);
    } else {
      lenAndCount[i].second /= 2;
      if (lenAndCount[i].second != 0) newLenAndCount.push_back(lenAndCount[i]);
      if (i != lenAndCount.size() - 1 &&
          lenAndCount[i].first == lenAndCount[i + 1].first + 1) {
        lenAndCount[i + 1].second++;
      }
    }
  }
  long long res = 0;
  long long l, r;
  int i = 0;
  bool hasLeft = false;
  while (i < newLenAndCount.size()) {
    if (hasLeft) {
      r = newLenAndCount[i].first;
      newLenAndCount[i].second--;
      res += l * r;
    }
    if (newLenAndCount[i].second % 2 == 0) {
      hasLeft = false;
    } else {
      hasLeft = true;
    }
    tmpCount = newLenAndCount[i].second / 2;
    l = newLenAndCount[i].first;
    r = newLenAndCount[i].first;
    res += tmpCount * l * r;
    i++;
  }
  printf("%I64d\n", res);
  return 0;
}
