#include <bits/stdc++.h>
using namespace std;
long long const maxl = 1e6 + 10;
long long const maxn = 2e5 + 10;
long long g[maxl];
long long save[maxl];
long long n;
int main() {
  while (cin >> n) {
    memset(g, 0, sizeof(g));
    memset(save, 0, sizeof(save));
    for (long long t = 1; t <= n; t++) {
      long long k;
      scanf("%I64d", &k);
      save[k]++;
    }
    for (long long t = maxl - 1; t >= 1; t--) {
      if (((save[t] + g[t]) & 1) && (save[t] >= 1)) {
        save[t]--;
        g[t - 1]++;
        save[t] = ((save[t] + g[t]) >> 1);
      } else {
        save[t] = ((save[t] + g[t]) >> 1);
      }
    }
    long long S = 0;
    long long a = -1, b = -1;
    for (long long t = maxl - 1; t >= 1; t--) {
      if (save[t]) {
        if (b > 0) {
          S += t * b;
          save[t]--;
          a = b = -1;
          t++;
        } else {
          save[t]--;
          b = t;
          t++;
        }
      }
    }
    cout << S << endl;
  }
  return 0;
}
