#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<int, int> > p;
int best(int h) {
  int lim = n / 2;
  int curw = 0;
  int i;
  for (i = 0; i < n; i++) {
    if (p[i].first <= h) {
      break;
    } else {
      if (p[i].second > h) {
        return 2000000000;
      } else {
        lim--;
        curw += p[i].first;
      }
    }
  }
  if (lim < 0) return 2000000000;
  vector<pair<int, int> > vaux;
  for (; i < n; i++) {
    vaux.push_back(make_pair(p[i].first - p[i].second, p[i].second));
    curw += p[i].second;
  }
  if (lim == 0) {
    return h * curw;
  }
  sort(vaux.begin(), vaux.end());
  for (int j = 0; j < vaux.size(); j++) {
    if (lim == 0) {
      break;
    }
    if (vaux[j].second <= h and vaux[j].first < 0) {
      lim--;
      curw += vaux[j].first;
    }
  }
  return h * curw;
}
int main() {
  cin >> n;
  int mx = 0;
  for (int i = 0; i < n; i++) {
    int w, h;
    cin >> w >> h;
    mx = max(w, mx);
    mx = max(h, mx);
    p.push_back(make_pair(h, w));
  }
  sort(p.rbegin(), p.rend());
  int minarea = 2000000000;
  for (int i = 1; i <= mx; i++) {
    int cur = best(i);
    if (cur < minarea) {
      minarea = cur;
    }
  }
  cout << minarea << endl;
  return 0;
}
