#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > a(n);
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  long long mn = 1000000000000;
  for (int i = 0; i < n; i++) {
    long long H = a[i].first;
    long long W = 0;
    int cnt = n / 2;
    priority_queue<int> q;
    for (int j = 0; j < n; j++) {
      if (a[j].second > H) {
        cnt--;
        W += a[j].second;
        if (a[j].first > H) W = 2000000000ll;
      } else {
        W += a[j].first;
        if (a[j].first <= H) {
          q.push(a[j].first - a[j].second);
        }
      }
    }
    while (cnt > 0 && q.top() > 0) {
      W -= q.top();
      q.pop();
      cnt--;
    }
    if (cnt >= 0) mn = min(mn, W * H);
    H = a[i].second;
    W = 0;
    cnt = n / 2;
    q = priority_queue<int>();
    for (int j = 0; j < n; j++) {
      if (a[j].second > H) {
        cnt--;
        W += a[j].second;
        if (a[j].first > H) W = 2000000;
      } else {
        W += a[j].first;
        if (a[j].first <= H) {
          q.push(a[j].first - a[j].second);
        }
      }
    }
    while (cnt > 0 && !q.empty() && q.top() > 0) {
      W -= q.top();
      q.pop();
      cnt--;
    }
    if (cnt >= 0) mn = min(mn, W * H);
  }
  cout << mn << endl;
}
