#include <bits/stdc++.h>
using namespace std;
double h(std::vector<double> l) {
  double W = 0, y;
  std::set<std::pair<double, double>> S{{-1, 0}};
  for (auto w : l) {
    auto a = S.lower_bound({w, -1}), b = a;
    y = prev(a)->second + w;
    for (; b != S.end() && b->second <= y; b++) {
    }
    a != b ? S.erase(a, b) : a;
    W = y > W ? y : W;
    S.insert({w, y});
  }
  return W;
}
int main() {
  int n;
  cin >> n;
  double pi = acos(-1);
  vector<double> l(n);
  for (int i = 0; i < n; i++) {
    double r, h;
    cin >> r >> h;
    l[i] = pi * r * r * h;
  }
  cout << setprecision(10) << fixed << h(l) << endl;
}
