#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
int a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  long long res = 0, now = 1, cnt = 0;
  for (int i = n; i >= 2; i--) {
    if (a[i] == a[i - 1] || a[i] == a[i - 1] + 1) {
      now *= a[i - 1];
      if (++cnt == 2) {
        res += now;
        cnt = 0;
        now = 1;
      }
      i--;
    }
  }
  cout << res << endl;
}
