#include <bits/stdc++.h>
using namespace std;
template <class T>
T Bitcnt(T a) {
  int sum = 0;
  while (a) {
    if (a & 1) sum++;
    a /= 2;
  }
  return sum;
}
template <class T>
T Max3(T a, T b, T c) {
  return max(a, max(b, c));
}
template <class T>
T Lcm(T a, T b) {
  T tmp = __gcd(a, b);
  return (a / tmp) * b;
}
template <class T>
T Pow(T a, T b) {
  T ans = 1;
  T base = a;
  while (b) {
    if (b & 1) ans = (ans * base);
    base = (base * base);
    b /= 2;
  }
  return ans;
}
long long Bigmod(long long a, long long b) {
  long long res = 1;
  long long pw = a % 1000000007LL;
  while (b > 0) {
    if (b & 1) res = (res * pw) % 1000000007LL;
    pw = (pw * pw) % 1000000007LL;
    b /= 2;
  }
  return res;
}
int a_x[] = {1, -1, 0, 0};
int a_y[] = {0, 0, 1, -1};
long long X, Y;
void extend_euclid(long long a, long long b) {
  if (b == 0) {
    X = a;
    Y = 0;
    return;
  }
  extend_euclid(b, a % b);
  long long x, y;
  x = Y;
  y = X - (a / b) * Y;
  X = x;
  Y = y;
}
long long inverse_modulo(long long a, long long b) {
  extend_euclid(a, b);
  return (X + 1000000007LL) % 1000000007LL;
}
long long dist(int x1, int y1, pair<int, int> tmp) {
  long long t = 1LL * (x1 - tmp.first) * (x1 - tmp.first) +
                1LL * (y1 - tmp.second) * (y1 - tmp.second);
  return (long long)(t);
}
bool collinear(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  int area;
  area = a.first * (b.second - c.second) + b.first * (c.second - a.second) +
         c.first * (a.second - b.second);
  return area;
}
long long tree[4 * 200005];
struct info {
  int indx;
  long long vol;
  bool operator<(const info &p) const {
    if (vol == p.vol) return indx > p.indx;
    return vol < p.vol;
  }
} data[4000000];
void update(int node, int b, int e, int indx, long long val) {
  if (b == e) {
    tree[node] = val;
    return;
  }
  int mid = (b + e) / 2;
  if (indx <= mid)
    update(node * 2, b, mid, indx, val);
  else
    update(node * 2 + 1, mid + 1, e, indx, val);
  tree[node] = max(tree[node * 2], tree[node * 2 + 1]);
}
long long query(int node, int b, int e, int i, int j) {
  if (i > j) return 0;
  if (i <= b && j >= e) return tree[node];
  int mid = (b + e) / 2;
  if (j <= mid)
    return query(node * 2, b, mid, i, j);
  else if (i > mid)
    return query(node * 2 + 1, mid + 1, e, i, j);
  else {
    return max(query(node * 2, b, mid, i, j),
               query(node * 2 + 1, mid + 1, e, i, j));
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    long long r, h;
    scanf("%lld %lld", &r, &h);
    data[i - 1].vol = r * r * h;
    data[i - 1].indx = i;
  }
  sort(data, data + n);
  long long ans = 0;
  for (int i = 0; i <= n - 1; i++) {
    long long t = query(1, 1, n, 1, data[i].indx - 1);
    ans = max(ans, t + data[i].vol);
    update(1, 1, n, data[i].indx, t + data[i].vol);
  }
  double res = ans * 1.0 * acos(-1.0);
  printf("%.12lf\n", res);
  return 0;
}
