#include <bits/stdc++.h>
using namespace std;
const int inf = 2e9;
const double eps = 1e-9;
const int maxn = 1e5 + 5, base = 1e9 + 7;
const long long maxV = 1e12 + 500;
map<long long, long long> t;
long long sum(long long r) {
  long long ans = 0;
  while (r > 0) {
    if (t.find(r) != t.end()) ans = max(ans, t[r]);
    r -= r & (-r);
  }
  return ans;
}
void update(long long i, long long x) {
  while (i < maxV) {
    if (t.find(i) == t.end())
      t[i] = x;
    else
      t[i] = max(t[i], x);
    i += (i & (-i));
  }
}
int main() {
  int n;
  vector<long long> ob;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    long long r, h;
    scanf("%I64d %I64d", &r, &h);
    long long v = r * r * h;
    ob.push_back(v);
    long long tans = sum(v - 1);
    long long old = sum(v);
    if (v + tans > old) {
      update(v, v + tans);
    }
  }
  long long ans = 0;
  for (int i = 0; i < ob.size(); i++) {
    long long v = ob[i];
    ans = max(ans, sum(v));
  }
  long double p = 3.14159265358979;
  long double good = (long double)ans * p;
  cout << fixed << setprecision(20) << good;
  return 0;
}
