#include <bits/stdc++.h>
using namespace std;
long long a[1000006], n, c, ans;
queue<int> q;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    a[x]++;
  }
  for (int i = 1000000; i > 0; --i) {
    int cc = a[i] && ((a[i] + c) & 1);
    a[i] = (c + a[i]) / 2;
    for (int k = 0; k < a[i]; k++) q.push(i);
    c = cc;
  }
  while (q.size() > 1) {
    long long a = q.front();
    q.pop();
    long long b = q.front();
    q.pop();
    ans += a * b;
  }
  cout << ans << "\n";
  return 0;
}
