#include <bits/stdc++.h>
using namespace std;
const int inf = 0x7fffffff;
const long long Linf = 1ll << 61;
const double EPS = 1e-10;
void get_int(int &x) {
  char t = getchar();
  bool neg = false;
  x = 0;
  for (; (t > '9' || t < '0') && t != '-'; t = getchar())
    ;
  if (t == '-') neg = true, t = getchar();
  for (; t <= '9' && t >= '0'; t = getchar()) x = x * 10 + t - '0';
  if (neg) x = -x;
}
void get_int(long long &x) {
  char t = getchar();
  bool neg = false;
  x = 0;
  for (; (t > '9' || t < '0') && t != '-'; t = getchar())
    ;
  if (t == '-') neg = true, t = getchar();
  for (; t <= '9' && t >= '0'; t = getchar()) x = x * 10 + t - '0';
  if (neg) x = -x;
}
void print_int(int x) {
  if (x < 0) putchar('-'), x = -x;
  short a[20] = {}, sz = 0;
  while (x > 0) a[sz++] = x % 10, x /= 10;
  if (sz == 0) putchar('0');
  for (int i = sz - 1; i >= 0; i--) putchar('0' + a[i]);
}
void print_int(long long x) {
  if (x < 0) putchar('-'), x = -x;
  short a[20] = {}, sz = 0;
  while (x > 0) a[sz++] = x % 10, x /= 10;
  if (sz == 0) putchar('0');
  for (int i = sz - 1; i >= 0; i--) putchar('0' + a[i]);
}
const int maxn = 100005;
const double pi = acos(-1.0);
long long vol[maxn], bit[maxn];
int n, r[maxn], h[maxn];
void change(int x, long long y) {
  for (; x <= n; x += x & -x) bit[x] = max(bit[x], y);
}
long long query(int x) {
  long long ret = 0;
  for (; x > 0; x -= x & -x) ret = max(ret, bit[x]);
  return ret;
}
vector<long long> all;
int main() {
  get_int(n);
  for (int i = 1; i <= n; i++) {
    get_int(r[i]), get_int(h[i]);
    vol[i] = r[i] * 1ll * r[i] * h[i];
    all.push_back(vol[i]);
  }
  sort(all.begin(), all.end());
  for (int i = 1; i <= n; i++) {
    int num = upper_bound(all.begin(), all.end(), vol[i]) - all.begin();
    change(num, query(num - 1) + vol[i]);
  }
  printf("%.10lf\n", pi * query(n));
  return 0;
}
