#include <bits/stdc++.h>
using namespace std;
const double pi = 3.14159265358979323846;
int n;
double tree[100005];
pair<double, int> p[100005];
void init() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    double r, h;
    cin >> r >> h;
    p[i].first = r * r * h;
    p[i].second = -(i + 1);
  }
}
double query(int pos) {
  double maxf = 0;
  while (pos > 0) {
    maxf = max(maxf, tree[pos]);
    pos -= (pos & (-pos));
  }
  return maxf;
}
void update(int pos, double val) {
  while (pos <= n) {
    tree[pos] = max(tree[pos], val);
    pos += (pos & (-pos));
  }
}
void solve() {
  sort(p, p + n);
  double best = 0;
  for (int i = 0; i < n; i++) {
    p[i].second *= -1;
    double curr = query(p[i].second - 1);
    curr += p[i].first;
    best = max(best, curr);
    update(p[i].second, curr);
  }
  cout << setprecision(9) << fixed << pi * best << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  init();
  solve();
  return 0;
}
