#include <bits/stdc++.h>
using namespace std;
long long f[100100], x[100100], a[100100];
long long t[100100];
int lowbit[100100];
int i, j, n, p;
long long r, h, c, w;
const double pi = acos(-1);
map<long long, int> ra;
void Add(int x, long long c) {
  while (x <= n) {
    t[x] = max(t[x], c);
    x += lowbit[x];
  }
}
long long Que(int x) {
  long long c;
  c = 0;
  while (x > 0) {
    c = max(c, t[x]);
    x -= lowbit[x];
  }
  return c;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%I64d%I64d", &r, &h);
    a[i] = r * r * h;
    x[i] = a[i];
  }
  sort(x + 1, x + 1 + n);
  for (i = 1; i <= n; i++) ra[x[i]] = i;
  for (i = 1; i <= n; i++) lowbit[i] = i & (-i);
  for (i = 1; i <= n; i++) {
    w = ra[a[i]];
    f[i] = a[i] + Que(w - 1);
    Add(w, f[i]);
  }
  c = 0;
  for (i = 1; i <= n; i++) c = max(c, f[i]);
  printf("%.15lf\n", c * pi);
  return 0;
}
