#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9, N = 100010;
const long long INFL = 1e18;
int n;
int r[N], h[N];
long long V[N], pos[N];
long long f[N], T[N];
long long ans;
vector<pair<long long, long long> > a;
void upd(int x, long long val) {
  for (; x <= n; x += x & -x) T[x] = max(T[x], val);
}
long long get(int x) {
  long long res = 0;
  for (; x > 0; x -= x & -x) res = max(res, T[x]);
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++)
    cin >> r[i] >> h[i], V[i] = 1LL * r[i] * r[i] * h[i],
                         a.push_back(pair<long long, long long>(V[i], i));
  sort(a.begin(), a.end());
  for (int i = 1; i <= n; i++) {
    pos[i] =
        lower_bound(a.begin(), a.end(), pair<long long, long long>(V[i], 0)) -
        a.begin() + 1;
  }
  for (int i = 1; i <= n; i++) {
    f[i] = get(pos[i] - 1) + V[i];
    upd(pos[i], f[i]);
  }
  for (int i = 1; i <= n; i++) ans = max(ans, f[i]);
  cout << setprecision(6) << fixed << (double)M_PI * ans << "\n";
}
