#include <bits/stdc++.h>
using namespace std;
struct cakes {
  long long r, h, v;
  int id;
} cake[100000 + 5], sup[100000 + 5];
long long ans, f[100000 + 5];
int n;
bool comp(cakes a, cakes b) { return a.v < b.v; }
void solve(int l, int r) {
  if (l == r) {
    f[l] += cake[l].v;
    ans = max(ans, f[l]);
    return;
  }
  int ls = l, mid = (l + r) / 2, rs = mid + 1;
  for (int i = l; i <= r; i++)
    if (cake[i].id <= mid)
      sup[ls++] = cake[i];
    else
      sup[rs++] = cake[i];
  for (int i = l; i <= r; i++) cake[i] = sup[i];
  solve(l, mid);
  deque<pair<long long, long long> > q;
  for (int i = l; i <= mid; i++)
    if (q.empty() || f[cake[i].id] > q.back().second)
      q.push_back(make_pair(cake[i].v, f[cake[i].id]));
  long long sd = 0;
  for (int i = mid + 1; i <= r; i++) {
    while (!q.empty() && q.front().first < cake[i].v)
      sd = max(sd, q.front().second), q.pop_front();
    f[cake[i].id] = max(f[cake[i].id], sd);
  }
  solve(mid + 1, r);
  ls = l, rs = mid + 1;
  for (int i = l; i <= r; i++)
    if (rs > r || (ls <= mid && cake[ls].v < cake[rs].v))
      sup[i] = cake[ls++];
    else
      sup[i] = cake[rs++];
  for (int i = l; i <= r; i++) cake[i] = sup[i];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d%I64d", &cake[i].r, &cake[i].h);
    cake[i].id = i;
    cake[i].v = cake[i].r * cake[i].r * cake[i].h;
  }
  sort(cake + 1, cake + n + 1, comp);
  solve(1, n);
  printf("%.10lf", (double)ans * 3.141592653589793);
  return 0;
}
