#include <bits/stdc++.h>
using namespace std;
long long n, l, ara[1010100];
int cnt[1001100], pos[1010100], dt[1010100];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ara[i];
    cnt[ara[i]]++;
  }
  sort(ara, ara + n);
  reverse(ara, ara + n);
  bool gotone = 0;
  long long ans = 0, prev;
  for (int i = 0; i < n; i++) {
    if (cnt[ara[i] + 1]) {
      cnt[ara[i]]--;
      cnt[ara[i] + 1]--;
      if (!gotone) {
        prev = ara[i];
        gotone = 1;
      } else {
        gotone = 0;
        ans += (prev * ara[i]);
      }
    } else if (cnt[ara[i]] > 1) {
      cnt[ara[i]]--;
      cnt[ara[i]]--;
      if (!gotone) {
        prev = ara[i];
        gotone = 1;
      } else {
        gotone = 0;
        ans += (prev * ara[i]);
      }
    }
  }
  cout << ans << endl;
}
