#include <bits/stdc++.h>
using namespace std;
static const double Pi = acos(-1.0);
pair<long long, int> *cakesAndIndex;
class MyMegaTree {
 public:
  int size;
  MyMegaTree(int s) {
    size = s;
    tree = new long long[s * 4];
    for (int i = 0; i < size * 4; ++i) tree[i] = 0;
  }
  void set(int pos, long long val) { setValue(1, 0, size, pos, val); }
  long long Max(int l, int r) { return getMax(1, 0, size, l, r); }

 private:
  long long *tree;
  void setValue(int v, int tl, int tr, int pos, long long val) {
    if (tl == tr)
      tree[v] = val;
    else {
      int tm = (tl + tr) / 2;
      if (pos <= tm)
        setValue(v * 2, tl, tm, pos, val);
      else
        setValue(v * 2 + 1, tm + 1, tr, pos, val);
      tree[v] = max(tree[v * 2], tree[v * 2 + 1]);
    }
  }
  long long getMax(int v, int tl, int tr, int l, int r) {
    if (l > r) return 0;
    if (l == tl && r == tr) return tree[v];
    int tm = (tl + tr) / 2;
    return max(getMax(v * 2, tl, tm, l, min(r, tm)),
               getMax(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r));
  }
};
int main() {
  int n;
  cin >> n;
  int r, h;
  cakesAndIndex = new pair<long long, int>[n];
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &r, &h);
    cakesAndIndex[i].first = 1ll * r * r * h;
    cakesAndIndex[i].second = -i;
  }
  sort(cakesAndIndex, cakesAndIndex + n);
  int currIndex;
  long long val, prevMax;
  MyMegaTree Tree(n);
  for (int i = 0; i < n; ++i) {
    currIndex = -cakesAndIndex[i].second;
    val = cakesAndIndex[i].first;
    prevMax = Tree.Max(0, currIndex);
    Tree.set(currIndex, prevMax + val);
  }
  cout << fixed;
  cout << fixed << setprecision(9);
  cout << Tree.Max(0, n - 1) * Pi << endl;
  cin >> n;
  return 0;
}
