#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
vector<long long> V;
vector<pair<long long, long long> > VOP;
queue<int> Q;
deque<int> DEQ;
pair<int, int> P;
long long n = 0, m = 0;
long long minimal = 2000000007, maximal = -2000000007, previous = 0;
long long x = 0, y = 0, z = 0;
char c;
long long ans = 0, now = 0;
long long counter = 0;
string s;
bool simple = false;
long long a[100010], i;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (i = n - 2; i >= 0; i--)
    if (a[i + 1] - a[i] < 2) {
      if (m)
        ans += m * a[i], m = 0;
      else
        m = a[i];
      i--;
    }
  cout << ans << endl;
}
