#include <bits/stdc++.h>
using namespace std;
struct Tree {
  int l, r;
  long long mx;
  Tree() { l = r = mx = 0; }
  Tree(int _l, int _r, long long m) {
    l = _l;
    r = _r;
    mx = m;
  }
};
Tree tree[8123456];
void build(int l, int r, int v) {
  tree[v] = Tree(l, r, 0);
  if (l == r) return;
  int m = (l + r) / 2;
  build(l, m, 2 * v);
  build(m + 1, r, 2 * v + 1);
}
long long getMx(int l, int r, int v) {
  if (tree[v].l >= l && tree[v].r <= r) return tree[v].mx;
  if (tree[v].l > r || tree[v].r < l) return 0;
  int vv = 2 * v;
  return max(getMx(l, r, vv), getMx(l, r, vv + 1));
}
void setVal(int i, long long x) {
  int v = 1;
  while (tree[v].l != tree[v].r) {
    if (tree[2 * v].r >= i)
      v <<= 1;
    else
      v = 2 * v + 1;
  }
  tree[v].mx = x;
  v >>= 1;
  while (v) {
    tree[v].mx = max(tree[2 * v].mx, tree[2 * v + 1].mx);
    v >>= 1;
  }
}
long long dp[654321];
int wh[654321];
int main() {
  ios_base::sync_with_stdio(0);
  srand(time(0));
  int n;
  cin >> n;
  vector<pair<long long, int> > v, vv;
  for (int i = 0; i < n; ++i) {
    long long r, h;
    cin >> r >> h;
    v.push_back(make_pair(r * r * h, i));
  }
  vv = v;
  sort(v.begin(), v.end());
  for (int i = 0; i < n - 1; ++i) {
    if (v[i].first == v[i + 1].first) {
      int ii = i;
      while (ii < n - 1 && v[ii].first == v[ii + 1].first) ++ii;
      reverse(v.begin() + i, v.begin() + ii + 1);
      i = ii;
    }
  }
  for (int i = 0; i < n; ++i) wh[v[i].second] = i;
  build(1, n, 1);
  for (int i = 0; i < n; ++i) {
    long long mx = getMx(1, wh[i], 1);
    dp[i] = mx + vv[i].first;
    setVal(wh[i] + 1, dp[i]);
  }
  printf("%.12f", (*max_element(dp, dp + n)) * 3.14159265358979);
  return 0;
}
