#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int n;
long long a[100005];
long long Dp[100005];
long long C[100005];
long long V[100005];
int Lowbit(int x) { return x & (-x); }
long long Getmax(int r) {
  long long ans = 0;
  while (r > 0) {
    ans = max(ans, C[r]);
    r -= Lowbit(r);
  }
  return ans;
}
void Update(int l, long long x) {
  while (l < n + 1) {
    C[l] = max(C[l], x);
    l += Lowbit(l);
  }
}
int main() {
  long long r, h;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> r >> h, a[i] = r * r * h, V[i] = a[i];
  memset(Dp, 0, sizeof(Dp));
  memset(C, 0, sizeof(C));
  sort(a + 1, a + n + 1);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    int k = lower_bound(a + 1, a + n + 1, V[i]) - a;
    if (k > 1)
      Dp[i] = V[i] + Getmax(k - 1);
    else
      Dp[i] = V[i];
    Update(k, Dp[i]);
    ans = max(ans, Dp[i]);
  }
  printf("%.9lf\n", (double)ans * pi);
  return 0;
}
