#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:167772160000")
using namespace std;
long long fen[100100];
long long vol[100100];
long long answer;
map<long long, int> comp;
long long find(long long a) {
  if (a == 0) return 0;
  return max(fen[a], find(a - (a & (-a))));
}
void upd(long long a, long long b) {
  if (a > 100500) return;
  fen[a] = max(fen[a], b);
  upd(a + (a & (-a)), b);
}
int main() {
  set<long long> vo;
  for (int i = 0; i < (int)100100; i++) fen[i] = 0;
  int n;
  cin >> n;
  for (int i = 1; i <= (int)n; i++) {
    long long r, h;
    cin >> r >> h;
    vol[i] = r * r * h;
    vo.insert(vol[i]);
  }
  int d = 0;
  for (set<long long>::iterator it = vo.begin(); it != vo.end(); it++) {
    comp[*it] = ++d;
  }
  answer = 0;
  for (int i = 1; i <= (int)n; i++) {
    long long wh = comp[vol[i]];
    long long best = find(wh - 1) + vol[i];
    best = max(best, fen[wh]);
    upd(wh, best);
    answer = max(answer, best);
  }
  cout << fixed << setprecision(10) << answer * 3.1415926535897932384626433;
  return 0;
}
