#include <bits/stdc++.h>
using namespace std;
long long n, r[100005], h[100005], a[100005], y, dp[100005], t[100005];
vector<long long> v;
map<long long, long long> m;
long long Max(long long r) {
  long long ans = 0;
  for (; r >= 0; r = (r & r + 1) - 1) ans = max(ans, t[r]);
  return ans;
}
void upd(long long i, long long d) {
  for (; i < y; i = (i | i + 1)) t[i] = max(t[i], d);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> r[i] >> h[i];
    a[i] = r[i] * r[i] * h[i];
    v.push_back(a[i]);
  }
  sort(v.begin(), v.end());
  y = 1;
  for (auto to : v) {
    if (m[to] == 0) {
      m[to] = y;
      y++;
    }
  }
  for (long long i = 0; i < n; i++) {
    long long x = m[a[i]];
    dp[x] = max(dp[x], Max(x - 1) + a[i]);
    upd(x, dp[x]);
  }
  cout << setprecision(20) << (long double)Max(y - 1) * 3.14159265358979;
}
