#include <bits/stdc++.h>
using namespace std;
int n, a[222222];
long long sol(int index, int firstSide) {
  for (int i = index; i > 0; i--)
    if (a[i] - a[i - 1] < 2) {
      if (firstSide > 0)
        return (long long)firstSide * (long long)a[i - 1] + sol(i - 2, -1);
      return sol(i - 2, a[i - 1]);
    }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  cout << sol(n - 1, -1) << endl;
  return 0;
}
