#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 18, ROOT = 1;
double cell[N * 2];
int lo[N * 2], hi[N * 2];
int L(int first) { return first * 2; }
int R(int first) { return first * 2 + 1; }
void construct(int idx, int l, int r) {
  lo[idx] = l;
  hi[idx] = r;
  cell[idx] = 0;
  if (l + 1 >= r) return;
  int md = (l + r) >> 1;
  construct(L(idx), l, md);
  construct(R(idx), md, r);
}
void ins(int idx, int l, int r, double v) {
  if (l >= hi[idx] || r <= lo[idx]) return;
  if (l <= lo[idx] && r >= hi[idx]) {
    cell[idx] = v;
  } else {
    ins(L(idx), l, r, v);
    ins(R(idx), l, r, v);
    cell[idx] = max(cell[L(idx)], cell[R(idx)]);
  }
}
double query(int idx, int l, int r) {
  l = max(l, lo[idx]);
  r = min(r, hi[idx]);
  if (l >= r) return 0.0;
  if (l == lo[idx] && r == hi[idx]) {
    return cell[idx];
  } else {
    return max(query(L(idx), l, r), query(R(idx), l, r));
  }
}
int main() {
  int n;
  while (cin >> n) {
    construct(ROOT, 0, n);
    vector<pair<long long, long long> > evt;
    for (int i = (0); i < (int)(n); i++) {
      long long r, h;
      cin >> r >> h;
      evt.push_back(pair<long long, long long>(r * r * h, -i));
    }
    sort((evt).begin(), (evt).end());
    for (__typeof((evt).begin()) it = (evt).begin(); it != (evt).end(); it++) {
      int i = -it->second;
      double mx = query(ROOT, 0, i);
      ins(ROOT, i, i + 1, mx + it->first);
    }
    double ans = query(ROOT, 0, n) * acos(-1.0);
    printf("%lf\n", ans);
  }
}
