#include <bits/stdc++.h>
using namespace std;
int n;
long long int q[500010], dp[100010];
pair<long long int, int> cakes[100010];
void update(int idx, long double x, int id = 1, int b = 0, int e = n) {
  if (idx < b || idx > e) return;
  if (idx == b && e - b == 1) {
    q[id] = dp[b] = x;
    return;
  }
  int mid = b + e >> 1, l = id << 1, r = l | 1;
  if (idx < mid)
    update(idx, x, l, b, mid);
  else
    update(idx, x, r, mid, e);
  q[id] = max(q[l], q[r]);
}
long long int query(int ql, int qr, int id = 1, int b = 0, int e = n) {
  if (ql >= e || qr <= b) return 0;
  if (ql <= b && qr >= e) return q[id];
  int mid = b + e >> 1, l = id << 1, r = l | 1;
  return max(query(ql, qr, l, b, mid), query(ql, qr, r, mid, e));
}
int main() {
  scanf("%d", &n);
  memset(q, 0, sizeof(q));
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < n; i++) {
    long long int r, h;
    scanf("%I64d %I64d", &r, &h);
    cakes[i].first = r * r * h;
    cakes[i].second = -i;
  }
  sort(cakes, cakes + n);
  for (int i = 0; i < n; i++) {
    int idx = -cakes[i].second;
    long long int curr = cakes[i].first;
    dp[idx] = query(0, idx) + curr;
    update(idx, dp[idx]);
  }
  printf("%.9llf", query(0, n) * M_PI);
  return 0;
}
