#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int inf = 1e5 + 5;
const int MAXM = 1e5 + 5;
const int MAXN = 2e5 + 4;
map<long long, int> mapp;
int r[MAXM], h[MAXM];
double dp[MAXM];
double bit[MAXM];
void update(int idx, double val) {
  while (idx < MAXM) {
    bit[idx] = max(bit[idx], val);
    idx += (idx & -idx);
  }
}
double get(int idx) {
  double ret = 0.0;
  while (idx > 0) {
    ret = max(ret, bit[idx]);
    idx -= (idx & -idx);
  }
  return ret;
}
int main() {
  int n, i, j, k;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &r[i]);
    scanf("%d", &h[i]);
    long long area = 1LL * r[i] * 1LL * r[i] * 1LL * h[i];
    mapp[area];
  }
  int c = 1;
  map<long long, int>::iterator it;
  for (it = mapp.begin(); it != mapp.end(); it++) {
    it->second = c++;
  }
  for (i = 1; i <= n; i++) {
    long long area = 1LL * r[i] * 1LL * r[i] * 1LL * h[i];
    double vol = 3.14159265358979323 * area;
    dp[i] = vol + get(mapp[area] - 1);
    update(mapp[area], dp[i]);
  }
  double ans = get(MAXM - 1);
  printf("%0.6lf\n", ans);
  return 0;
}
