#include <bits/stdc++.h>
using namespace std;
const long long oo = 1ll << 55;
int N;
pair<long long, long long> A[100100];
long long H, W, sol;
priority_queue<long long> Q;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  for (int I = 0; I < N; I++) cin >> A[I].second >> A[I].first;
  sol = oo;
  for (int I = 0; I < N; I++) {
    for (int r = 0; r < 2; r++) {
      int cnt = N / 2;
      H = A[I].first;
      W = A[I].second;
      if (r) swap(H, W), cnt--;
      while (!Q.empty()) Q.pop();
      for (int K = 0; K < N; K++)
        if (I != K) {
          if (A[K].first > H) {
            if (A[K].second > H) {
              H = 1, W = oo, cnt = 0;
              break;
            } else {
              W += A[K].first;
              cnt--;
              if (cnt < 0) {
                H = 1, W = oo, cnt = 0;
                break;
              }
            }
          } else {
            W += A[K].second;
            if (A[K].second <= H) Q.push(A[K].second - A[K].first);
          }
        }
      while (cnt > 0 && !Q.empty() && Q.top() > 0) {
        W -= Q.top();
        Q.pop();
        cnt--;
      }
      sol = min(sol, H * W);
    }
  }
  cout << sol << endl;
}
