#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
long long n, r[N], h[N], a[N];
pair<double, int> s[N];
double bit[N], v[N], f[N], res = 0;
void update(int x, double w) {
  while (x <= n) {
    bit[x] = max(bit[x], w);
    x += x & (-x);
  }
}
double get(int x) {
  double d = 0;
  while (x > 0) {
    d = max(d, bit[x]);
    x -= x & (-x);
  }
  return d;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> r[i] >> h[i];
    v[i] = M_PI * r[i] * r[i] * h[i];
    s[i] = make_pair(v[i], i);
  }
  sort(s + 1, s + n + 1);
  int cnt = 1;
  a[s[1].second] = 1;
  for (int i = 2; i <= n; i++) {
    if (s[i].first != s[i - 1].first) cnt++;
    a[s[i].second] = cnt;
  }
  for (int i = 1; i <= n; i++) {
    f[i] = get(a[i] - 1);
    f[i] += v[i];
    res = max(res, f[i]);
    update(a[i], f[i]);
  }
  printf("%.10lf\n", res);
  return 0;
}
