#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a, b, c, flag;
  unsigned long long value[10];
  unsigned long long sum;
  while (cin >> n) {
    int ara[n + 5];
    for (a = 0; a < n; a++) {
      scanf("%d", &ara[a]);
    }
    sort(ara, ara + n);
    flag = 0;
    sum = 0;
    for (a = n - 1; a > 0; a--) {
      if (ara[a] == ara[a - 1]) {
        flag++;
        value[flag] = ara[a];
        a--;
      } else if (ara[a] - 1 == ara[a - 1]) {
        flag++;
        value[flag] = ara[a - 1];
        a--;
      }
      if (flag == 2) {
        sum = sum + value[1] * value[2];
        flag = 0;
      }
    }
    cout << sum << endl;
  }
  return 0;
}
