#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const int inf = 0x3f3f3f3f;
double vol[N], c[N];
vector<double> v;
int n, g[N];
int getId(double res) {
  return lower_bound(v.begin(), v.end(), res) - v.begin() + 1;
}
void add(int x, double y) {
  c[x] = y;
  for (; x <= n; x += x & -x) c[x] = max(c[x], y);
}
double ask(int x) {
  double res = 0;
  for (; x; x -= x & -x) res = max(res, c[x]);
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    double r, h;
    scanf("%lf%lf", &r, &h);
    double vo = acos(-1) * r * r * h;
    vol[i] = vo;
    v.push_back(vo);
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  double res = 0;
  for (int i = 1; i <= n; i++) {
    int x = getId(vol[i]);
    double now = ask(x - 1) + vol[i];
    add(x, now);
    res = max(res, now);
  }
  printf("%.10lf\n", res);
  return 0;
}
