#include <bits/stdc++.h>
using namespace std;
int a[123456];
int f[123456];
struct node {
  int x, y;
} b[123456];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 2; i <= n; i++) f[i] = a[i] - a[i - 1];
  long long ans = 0;
  int i = n;
  while (1) {
    long long tmp = 0;
    int flag = 0;
    if (i <= 1) break;
    for (; i >= 2; i--) {
      if (f[i] == 0 || f[i] == 1) {
        tmp = a[i - 1];
        i = i - 2;
        flag++;
        break;
      }
    }
    if (!flag) break;
    for (; i >= 2; i--) {
      if (f[i] == 0 || f[i] == 1) {
        tmp *= a[i - 1];
        i = i - 2;
        flag++;
        break;
      }
    }
    if (flag == 2)
      ans += tmp;
    else
      break;
  }
  cout << ans;
  return 0;
}
