#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
struct Cake {
  long long V;
  int id;
  bool operator<(const Cake a) const {
    if (V != a.V) return V < a.V;
    return id > a.id;
  }
} cake[100005];
long long dp[400005];
int p;
long long v;
void update(int l, int r, int o) {
  if (l == r) {
    dp[o] = v;
    return;
  }
  int m = (l + r) / 2;
  if (p <= m)
    update(l, m, o * 2);
  else
    update(m + 1, r, o * 2 + 1);
  dp[o] = max(dp[o * 2], dp[o * 2 + 1]);
}
int ql, qr;
long long query(int l, int r, int o) {
  if (l >= ql && r <= qr) return dp[o];
  long long ret = 0;
  int mid = (l + r) / 2;
  if (ql <= mid) ret = max(ret, query(l, mid, o * 2));
  if (qr > mid) ret = max(ret, query(mid + 1, r, o * 2 + 1));
  return ret;
}
int main() {
  memset(dp, 0, sizeof(dp));
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    long long r, h;
    scanf("%lld%lld", &r, &h);
    cake[i].V = r * r * h;
    cake[i].id = i;
  }
  sort(cake + 1, cake + n + 1);
  for (int i = 1; i <= n; ++i) {
    ql = 1;
    qr = cake[i].id;
    v = query(1, n, 1) + cake[i].V;
    p = cake[i].id;
    update(1, n, 1);
  }
  ql = 1;
  qr = n;
  long long ans = query(1, n, 1);
  printf("%.6lf\n", ans * PI);
  return 0;
}
