#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  char c = getchar();
  bool f = 0;
  for (; c > '9' || c < '0'; f = c == '-', c = getchar())
    ;
  for (; c >= '0' && c <= '9'; x = (x << 1) + (x << 3) + c - '0', c = getchar())
    ;
  return f ? -x : x;
}
inline void write(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) write(x / 10);
  putchar(x % 10 + 48);
}
const int N = 100000 + 10;
int n;
long long v[N], has[N], t[N], ans;
void modify(int x, long long v) {
  for (; x <= n; x += x & -x) t[x] = max(t[x], v);
}
long long query(int x) {
  long long res = 0;
  for (; x; x -= x & -x) res = max(res, t[x]);
  return res;
}
int main() {
  n = read();
  for (int i = 1, _y = n; i <= _y; ++i) {
    int r = read(), h = read();
    v[i] = has[i] = 1ll * r * r * h;
  }
  sort(has + 1, has + n + 1);
  *has = unique(has + 1, has + n + 1) - has - 1;
  for (int i = 1, _y = n; i <= _y; ++i) {
    int x = lower_bound(has + 1, has + *has + 1, v[i]) - has;
    long long tmp = query(x - 1) + v[i];
    ans = max(ans, tmp);
    modify(x, tmp);
  }
  printf("%.10lf\n", 3.1415926535897932 * ans);
}
