#include <bits/stdc++.h>
using namespace std;
int n;
int r[100005];
int h[100005];
long long vol[100005];
long long ans[100005];
struct Node {
  long long left, right;
  Node *L, *R;
  long long res;
  Node() {
    left = right = res = 0;
    L = R = NULL;
  }
  void update(long long x, long long val) {
    if (right < x || x < left) return;
    if (left == right) {
      res = max(res, val);
      return;
    }
    if (L == NULL) {
      L = new Node();
      L->left = left;
      L->right = (left + right) >> 1;
    }
    L->update(x, val);
    if (R == NULL) {
      R = new Node();
      R->left = ((left + right) >> 1) + 1;
      R->right = right;
    }
    R->update(x, val);
    res = max(L->res, R->res);
  }
  long long get(long long x, long long y) {
    if (y < x) return 0;
    if (x <= left && right <= y) {
      return res;
    }
    if (y < left || right < x) return 0;
    long long ret = 0;
    if (L != NULL) ret = max(ret, L->get(x, y));
    if (R != NULL) ret = max(ret, R->get(x, y));
    return ret;
  }
};
Node T;
int main() {
  ios::sync_with_stdio(false);
  scanf("%d", &n);
  long long M = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", r + i, h + i);
    vol[i] = r[i] * 1LL * r[i] * 1LL * h[i];
    M = max(M, vol[i]);
  }
  T.left = 0;
  T.right = M;
  long long res = 0;
  for (int i = n - 1; i >= 0; i--) {
    ans[i] = T.get(vol[i] + 1, M) + vol[i];
    res = max(res, ans[i]);
    T.update(vol[i], ans[i]);
  }
  printf("%.13lf\n", res * M_PI);
  return 0;
}
