#include <bits/stdc++.h>
using namespace std;
const long long int mxn = 1e5 + 1;
string s, s1, s2, s3;
char ch[10000][10000];
int main() {
  long long int n, m, i, z, j, a = 0, ans = 0, k = 0, cnt = 0, b;
  long long int c = 0, x, y, d = 0, sum = 0, mn = INT_MAX, mx = 0;
  string ss, strn;
  char ch;
  cin >> n;
  long long int evn[n + 1], odd[n + 1], e = 0, o = 0;
  long long int ara[n + 2], bra[n + 1], cra[n + 1];
  map<long long int, long long int> mp;
  set<long long int> st;
  set<long long int>::iterator sit;
  priority_queue<long long int> pq;
  for (i = 1; i <= n; i++) {
    cin >> ara[i];
  }
  sort(ara + 1, ara + n + 1);
  for (i = n; i > 1; i--) {
    x = abs(ara[i] - ara[i - 1]);
    if (x <= 1) {
      if (!cnt) a = ara[i - 1];
      if (cnt == 1) b = ara[i - 1];
      cnt++;
      if (cnt == 2) {
        ans += (a * b);
        cnt = 0;
      }
      --i;
    }
  }
  cout << ans << endl;
  return 0;
}
