#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
ll max_pool[4 * 100000] = {0};
void update(int u, int l, int r, int cur, ll v) {
  if ((cur < l) || (cur > r)) {
    return;
  }
  if (l == r) {
    max_pool[u] = v;
    return;
  }
  int mid = (l + r) / 2;
  update(2 * u, l, mid, cur, v);
  update(2 * u + 1, mid + 1, r, cur, v);
  max_pool[u] = max(max_pool[2 * u], max_pool[2 * u + 1]);
}
ll query(int u, int l, int r, int ql, int qr) {
  if ((ql > r) || (qr < l)) {
    return 0;
  }
  if ((ql <= l) && (qr >= r)) {
    return max_pool[u];
  }
  int mid = (l + r) / 2;
  ll res1 = query(2 * u, l, mid, ql, qr);
  ll res2 = query(2 * u + 1, mid + 1, r, ql, qr);
  return max(res1, res2);
}
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0), cout.precision(15);
  const long double pi = acosl(-1);
  int n;
  cin >> n;
  vector<ll> v(n);
  vector<pair<ll, int> > vp(n);
  for (int i = 0; i < n; i++) {
    ll ri, hi;
    cin >> ri >> hi;
    v[i] = ri * ri * hi;
    vp[i].first = v[i];
    vp[i].second = i;
  }
  sort(vp.begin(), vp.end());
  vector<int> b(n);
  vector<int> prev(n);
  for (int i = 0; i < n; i++) {
    b[vp[i].second] = i;
    if (i == 0) {
      prev[i] = -1;
    } else {
      if (vp[i].first == vp[i - 1].first) {
        prev[i] = prev[i - 1];
      } else {
        prev[i] = i - 1;
      }
    }
  }
  ll res = 0;
  for (int i = 0; i < n; i++) {
    ll v_sum = v[i];
    if (prev[b[i]] >= 0) {
      v_sum += query(1, 0, n - 1, 0, prev[b[i]]);
    }
    res = max(res, v_sum);
    update(1, 0, n - 1, b[i], v_sum);
  }
  cout << fixed << res * pi << endl;
  return 0;
}
