#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
int n, m, d, tc = 1, q, cs = 1, len;
const int N = 1e5 + 5;
long long R[N], H[N];
long long dp[N];
long long tree[N * 4];
const long double one = 1.00000;
long long query(int l, int r, int x, int y, int nd = 1) {
  if (x > y) return 0;
  if (l > y || r < x) return 0;
  if (l >= x && r <= y) return tree[nd];
  int mid = (l + r) >> 1;
  long long r1 = query(l, mid, x, y, nd << 1);
  long long r2 = query(mid + 1, r, x, y, nd << 1 | 1);
  return r1 > r2 ? r1 : r2;
}
void update(int l, int r, int idx, long long val, int nd = 1) {
  if (l == r) {
    tree[nd] = val;
    return;
  }
  int mid = (l + r) >> 1;
  idx <= mid ? update(l, mid, idx, val, nd << 1)
             : update(mid + 1, r, idx, val, nd << 1 | 1);
  tree[nd] = max(tree[nd << 1], tree[nd << 1 | 1]);
  return;
}
void Solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> R[i] >> H[i];
  vector<pair<long long, int> > pr;
  for (int i = 1; i <= n; ++i) {
    pr.push_back(make_pair(R[i] * R[i] * H[i], -i));
  }
  sort((pr).begin(), (pr).end());
  for (pair<long long, int> t : pr) {
    int idx = -t.second;
    long long volume = t.first;
    dp[idx] = query(1, n, 1, idx - 1) + volume;
    update(1, n, idx, dp[idx]);
  }
  long long mx = 0;
  for (int i = 1; i <= n; ++i) {
    mx = max(mx, dp[i]);
  }
  long double ans = one * acos(-1) * mx;
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << setprecision(10) << fixed;
  while (tc--) {
    Solve();
  }
  return 0;
}
