#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long r, h;
    cin >> r >> h;
    long long vol = r * r * h;
    auto it = mp.lower_bound(vol);
    if (it == mp.begin())
      mp[vol] = vol;
    else {
      it--;
      long long v = vol + it->second;
      mp[vol] = v;
      it++, it++;
      while (it != mp.end() && it->second <= v) it = mp.erase(it);
    }
  }
  printf("%.10lf\n", 3.14159265358979323846 * (--mp.end())->second);
  return 0;
}
