#include <bits/stdc++.h>
const int z = 111111;
using namespace std;
int n;
long long a[z], used[z], ans;
vector<long long> take;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = n - 1; i; i--)
    if (!used[i] && !used[i - 1] && (a[i] - a[i - 1]) < 2) {
      used[i] = used[i - 1] = 1;
      take.push_back(a[i - 1]);
    }
  for (int i = 1; i < take.size(); i += 2) ans += take[i] * take[i - 1];
  cout << ans;
  return 0;
}
