#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 5;
const double PI = acos(-1);
const double eps = 1e-8;
double bit[maxn];
int n;
struct node {
  double v;
  int id;
  node(double v = 0, int id = 0) : v(v), id(id) {}
} cake[maxn];
void init() { memset(bit, 0, sizeof(bit)); }
void add(int i, double v) {
  while (i <= n) {
    bit[i] = max(bit[i], v);
    i += i & -i;
  }
}
double query(int i) {
  double ret = 0;
  while (i) {
    ret = max(ret, bit[i]);
    i -= i & -i;
  }
  return ret;
}
bool cmp(const node &a, const node &b) {
  if (fabs(a.v - b.v) <= eps) return a.id > b.id;
  return a.v < b.v;
}
int main() {
  while (~scanf("%d", &n)) {
    init();
    for (int i = 0; i < n; ++i) {
      int r, h;
      scanf("%d%d", &r, &h);
      cake[i] = node(PI * r * r * h, i + 1);
    }
    sort(cake, cake + n, cmp);
    double ans = 0;
    for (int i = 0; i < n; ++i) {
      double tmp = query(cake[i].id - 1) + cake[i].v;
      ans = max(ans, tmp);
      add(cake[i].id, tmp);
    }
    printf("%.10f\n", ans);
  }
  return 0;
}
